Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. def main():
  2.     UserInputList = []
  3.  
  4.     def main2(List, Options):
  5.         Addmore = True
  6.         count = 1
  7.         while Addmore:
  8.             count = 1
  9.             while len(List) < 8:
  10.                 string = input("Please enter word number " + str(count) + ": ")
  11.                 try:
  12.                     teststr = str(string)
  13.                     if teststr.isdigit():
  14.                         print("Please enter a string: ")
  15.                     else:
  16.                         List.append(string)
  17.                         count += 1
  18.                 except ValueError:
  19.                     print("Please enter a valid string: ")
  20.  
  21.             again = str(input("Do you want to add another word? Type Yes or No:"))
  22.             if again == "No" or "no":
  23.                 Addmore = False
  24.             elif again == "Yes" or "yes":
  25.                 Addmore == True
  26.             else:
  27.                 again
  28.  
  29.         print(List)
  30.     main2(UserInputList, InputOptions)
  31. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement