Vocabulary
|
Python
Countdownwhile True: user_number = input("Enter your number Here...") number = int(user_number) countdown_string = "" while number > 0: countdown_string = countdown_string + str(number) number = number - 1 print (countdown_string) Lettername = "Baifern" print (name. upper()) print (name. lower()) print (name. capitalize()) print (name. title()) BAIFERN baifern Baifern |
Guess word gameimport random #create a list guesslist = ['atom','mint','leoney'] chance = 3 score = 0 print (guesslist) while chance != 0 random_item = random.choice (guesslist) user_input = input("please guess a word: ") if user_input == random_item: print (that's correct!") else: if user_input not in guesslist: |
Cheatography
https://cheatography.com
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment