Advertisement
Talithacelin

Hobby

Sep 24th, 2022 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. #LISTOFHOBBY
  2. hobby = []
  3. stop = False
  4. i = 0
  5.  
  6. name = input("Hello! What's your name? ")
  7.  
  8. while(not stop):
  9.     new_hobby = input("Input hobby number -> {}:".format(i))
  10.     hobby.append(new_hobby)
  11.  
  12.     i += 1
  13.  
  14.     ask = input("Wanna insert more hobbies?: ")
  15.     if ask == "no" or ask == "No":
  16.         stop = True
  17.  
  18. print("=" *10)
  19. print("You have {} hobbies" .format(len(hobby)) , name , "!")
  20. for hb in hobby:
  21.     print("- {}".format(hb))
  22.  
  23. #Talice
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement