Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #line clears by doing 50 new lines
- def line_clear():
- for dontcare in range(50):
- print("\n")
- #not sure if sir is going to be ok with this.
- correct = 0
- incorrect = 0
- word_list = ['winter', 'berry','crosswalk', 'crackpot', 'persist', 'lesson', 'redeem']
- #picks from the word list a random word by using random number using that number as the pointer for the list
- the_word = word_list[random.randint(0,6)]
- #list() make a list out of each letter of that word seleteced from ^ and then len() counts it
- letters_list = list(the_word)
- letters_in_word =len(letters_list)
- #prints "__" for each letter there is in that word
- for x in range(letters_in_word):
- print("__")
- print("There are",letters_in_word,"letters")
- print(the_word) #To be removed
- #asks user for there letter
- #Need to add try expect Erros
- user_input = input("What is your letter: ")
- #makes a list from each letter of the word
- for loop_count in range(letters_in_word):
- if user_input == letters_list[loop_count - 1]:
- print("*DING DING DING* correct")
- correct += 1
- else:
- print("*BUZZER NOISE* INCORRECT ")
- incorrect += 1
- print(correct)
- print(incorrect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement