Advertisement
orson_dah

Untitled

Mar 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. import random
  2.  
  3.  
  4. #line clears by doing 50 new lines
  5. def line_clear():
  6.     for dontcare in range(50):
  7.         print("\n")
  8.  
  9.  
  10.  
  11.  
  12. #not sure if sir is going to be ok with this.
  13. correct = 0
  14. incorrect = 0
  15.  
  16.  
  17. word_list = ['winter', 'berry','crosswalk', 'crackpot', 'persist', 'lesson', 'redeem']
  18.  
  19.  
  20. #picks from the word list a random word by using random number using that number as the pointer for the list
  21. the_word = word_list[random.randint(0,6)]
  22.  
  23. #list() make a list out of each letter of that word seleteced from ^ and then len() counts it
  24. letters_list = list(the_word)
  25. letters_in_word =len(letters_list)
  26.  
  27. #prints "__" for each letter there is in that word
  28. for x in range(letters_in_word):
  29.     print("__")
  30.  
  31.  
  32. print("There are",letters_in_word,"letters")
  33.  
  34. print(the_word) #To be removed
  35.  
  36. #asks user for there letter
  37. #Need to add try expect Erros
  38. user_input = input("What is your letter: ")
  39.  
  40. #makes a list from each letter of the word
  41.  
  42.  
  43.  
  44. for loop_count in range(letters_in_word):
  45.     if user_input == letters_list[loop_count - 1]:
  46.         print("*DING DING DING* correct")
  47.         correct += 1
  48.  
  49.        
  50.        
  51.    
  52. else:
  53.     print("*BUZZER NOISE* INCORRECT ")
  54.     incorrect += 1
  55.  
  56.  
  57. print(correct)
  58. print(incorrect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement