Guest User

Untitled

a guest
Dec 12th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. fruits = ['apple', 'pear', 'banana', 'melon', 'grape', 'cherry', 'kiwi', 'persimmon', 'fruit1', 'fruit2','fruit3']
  2.  
  3.  
  4. for kittens in fruits:
  5. print(fruit)
  6.  
  7. fruit3
  8. fruit3
  9. fruit3
  10. fruit3
  11. fruit3
  12. fruit3
  13. fruit3
  14. fruit3
  15. fruit3
  16. fruit3
  17. fruit3
  18.  
  19. for fruit in fruits:
  20. print(num)
  21.  
  22. ---------------------------------------------------------------------------
  23. NameError Traceback (most recent call last)
  24. <ipython-input-422-f672ba99a550> in <module>()
  25. 1 for fruit in fruits:
  26. ----> 2 print(num)
  27.  
  28. NameError: name 'num' is not defined
  29.  
  30. for item in list:
  31. do something to item
Add Comment
Please, Sign In to add comment