Building a Guessing Game | Python | Tutorial 21

  Рет қаралды 81,615

Giraffe Academy

Giraffe Academy

Күн бұрын

Пікірлер: 111
@GabrieleValentini
@GabrieleValentini 6 жыл бұрын
This was my "Guessing game", before checking the way you did it :D secret_word = "giraffe" guess = "" attempt = 3 while guess != secret_word and attempt >= 1: attempt -= 1 guess = input("Enter guess: ") if attempt == 1: print("You still have " + str(attempt) + " attept") elif attempt == 0: print("You have no more attempts!") else: print("You still have " + str(attempt) + " attepts") if guess == secret_word: print("You win!") else: print("You lose!")
@garvitahuja9097
@garvitahuja9097 5 жыл бұрын
wrong
@Ryan_Parmelee
@Ryan_Parmelee 5 жыл бұрын
Here's how I did it. I simplified the code while still maintaining the same functionality. The only difference is I had to use the "break" statement. secretWord = "python" guess = "" guessCount = 0 while guess != secretWord: if guessCount == 3: break else: guess = input("Enter a guess: ") guessCount += 1 if guess == secretWord: print("You Win!") else: print("You Loose!")
@eloghosaomorogbe9143
@eloghosaomorogbe9143 5 жыл бұрын
Too long process
@tsareena5899
@tsareena5899 4 жыл бұрын
Check this out: secret_word = "Giraffe" guess = "" guess_count = 0 while guess != secret_word: if guess_count
@DailyBookInsights
@DailyBookInsights 4 жыл бұрын
@@Ryan_Parmelee 4
@karlson9036
@karlson9036 Жыл бұрын
I loved this tutorial! I spent a lot of time adding extra functions to my guessing game and expanding this! thank you!
@Ryan_Parmelee
@Ryan_Parmelee 5 жыл бұрын
Here's how I did it. I simplified the code while still maintaining the same functionality. The only difference is I had to use the "break" statement. secretWord = "python" guess = "" guessCount = 0 while guess != secretWord: if guessCount == 3: break else: guess = input("Enter a guess: ") guessCount += 1 if guess == secretWord: print("You Win!") else: print("You Loose!")
@tsareena5899
@tsareena5899 4 жыл бұрын
Check this out: secret_word = "Giraffe" guess = "" guess_count = 0 while guess != secret_word: if guess_count
@andeemengaming5000
@andeemengaming5000 4 жыл бұрын
your spelling of "lose" is wrong cuz what you spelt means the opposite of "tight" lol jk i know its an error anyway nice code
@Allisonpeers01010
@Allisonpeers01010 2 жыл бұрын
This really helped Thanks
@ozwrangler.c
@ozwrangler.c 2 жыл бұрын
Just used this video as an example of the best way to teach code to beginners. My course has all the abstract ideas (variables, iteration, etc.) followed by examples. IMO, that's an arse-about way to teach coding. My course content was so confusing I came to KZbin ...so glad to find your channel 😍
@AjayKumar-ln1vf
@AjayKumar-ln1vf 5 жыл бұрын
My way of doing word = "Guess" guess_word = "" limit = 3 while word != guess_word and limit != 0: guess_word = input("Enter word : ") limit -= 1 if word == guess_word: print("You win") else: print("You Lose")
@yohanes8006
@yohanes8006 5 жыл бұрын
make it simple, secret_word = "giraffe" guess = "" guess_count = 0 while guess != secret_word and guess_count < 3: guess = input("Enter a guess: ") guess_count += 1 if guess != secret_word: print("You lose!") else: print("You win!")
@mikeafter5
@mikeafter5 5 жыл бұрын
The second review was very helpful. Thanks!
@hominakra377
@hominakra377 4 жыл бұрын
This was my guessing game before watching his brilliant idea.... sw = "Insane" guess = "" attempt = 3 print("Hint :- Gopal") while guess != sw and attempt > 0: print("You have", attempt, "attempts left") guess = input("Enter your guess: ") attempt -= 1 if guess != sw: if attempt < 1: print("You lose") elif attempt > 1: print("try harder") elif guess == sw: print("Well Done")
@SYDNEYMALAMA-r8h
@SYDNEYMALAMA-r8h 4 ай бұрын
Write a program in Python for the following numerical game with additional features:  The computer stores a random number between 1 and 100.  The player (user) attempts to guess the number.  The player has a total of five attempts.  After each wrong guess, the computer tells the user if the number was too high or too low.  If the fifth attempt is also wrong, the number is output on screen.  The player wins if he or she can guess the number within five attempts.  The player is allowed to repeat the game as often as he or she wants.  Track the number of games played and the number of wins.  Provide an option to view the game statistics (number of games played, number of wins, and win percentage).  Implement input validation to ensure the user enters a valid number within the specified range.  Use object-oriented principles: Create classes for the game logic, player statistics, and user interface.  Add exception handling to manage unexpected errors who can finish this code?
@swapnilrandhir492
@swapnilrandhir492 4 жыл бұрын
Congrats on 100 k subscribers !🎉
@tsareena5899
@tsareena5899 4 жыл бұрын
using this guy's vid for understanding the language since I knew C from my school. Really he deserves to be known! I made this simplified version with less variables but with a break. Check it out ^_^ secret_word = "Giraffe" guess = "" guess_count = 0 while guess != secret_word: if guess_count
@japhethachimba174
@japhethachimba174 2 жыл бұрын
awesome
@ozwrangler.c
@ozwrangler.c 2 жыл бұрын
Kudos... like how you've simplified. Mike's example explains the concepts better.
@theundergroundsm
@theundergroundsm 5 жыл бұрын
My Guessing game code word = "refer" guess = "" guess_number = 0 guess_limit = 5 while guess != word and guess_number < guess_limit: guess = input("Enter the word: ") guess_number += 1 if guess != word: print("Try again!") if guess == word: print("You guessed the word!") else: print("You failed!")
@sweetlar5485
@sweetlar5485 2 жыл бұрын
This is REALLY GOOD!! You explain really well. Thank you!
@ranjanadissanayaka5390
@ranjanadissanayaka5390 2 жыл бұрын
hell yeah..I got my code right..... thanks so much Mike.
@andregomes7194
@andregomes7194 2 жыл бұрын
import random x= random.randrange(o,15) list= "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15" print(list) n=int(input('insere um número entre 0-15':)) while n!= x: print("errado! tente de novo") if x>n: print('adivinha um número maior') n=int(input('Insere outro número')) else: print('adivinha um número maior') n=int(input(Insere outro número' )) print('Está certo!') ~
@Abdelhalim-ElAbdi
@Abdelhalim-ElAbdi 3 жыл бұрын
I eneded up with a compact version of the code lemme know if it has any flows. Thank you secret_word = "Giraffe" guess = "" tries = 0 while secret_word != guess and tries < 3: guess = input("Please type your guess: ") tries += 1 if tries == 3 : print("You run out of chances") elif guess == secret_word: print("You won ")
@anandrao2308
@anandrao2308 2 жыл бұрын
secret_word="Test" guess="" trynumber=0 while guess!=secret_word : guess=input("Enter Guess : ") #print("try again") trynumber += 1 if trynumber>=3: #print("break") break if trynumber>=2 and guess!=secret_word: print("Your limit crossed") if guess==secret_word : print("You win ")
@zandovic
@zandovic 5 жыл бұрын
Fantastic tutorial! Is there a reason for why you use the variable "guess_limit" instead of just 3? Then you would just need to write "if guess_count < 3" instead of "if guess_count < guess_limit"
@miikurr1194
@miikurr1194 3 жыл бұрын
2 years late but i think its simply just to make the script more readable
@mehndi_with_aanchal3254
@mehndi_with_aanchal3254 2 жыл бұрын
Like your videos the most👏👏 The way u teach is amazing n helpful 🙌
@arenxou9914
@arenxou9914 4 жыл бұрын
Why do we need to set the guess=""? And why is it blank?
@Al-he6bs
@Al-he6bs 4 жыл бұрын
Same question. But I found something more understandable code for this that do not require variable "guess". Here it is: secret_word = "Giraffe" guess_count = 0 guess_limit = 3 while guess_count < guess_limit: guess = input("Guess: ") guess_count += 1 if guess == secret_word: print ("You won!) break else: print("You lose..")
@andeemengaming5000
@andeemengaming5000 4 жыл бұрын
@@Al-he6bs i think you just removed the guess variable
@anxiousearth680
@anxiousearth680 Жыл бұрын
I think, otherwise python will throw an error when guess is used as the condition after the While statement. Either because the variable needs to be defined first or because it needs to have some sort of value to be used. It's empty because the value will be redefined by Input in the loop anyway, so it doesn't matter what it contains at first.
@choppinhatiroagudo9200
@choppinhatiroagudo9200 4 жыл бұрын
thank you, your video saved me from a probleam.
@ashikurrahamanshuvo1012
@ashikurrahamanshuvo1012 5 жыл бұрын
Guessing Game (before i watch the video) secret_number = 7 guess = "" count = 0 while secret_number != guess and count != 5: guess = int(input("Enter the Guess : ")) count += 1 if count == 5: print("You fail!") else: print("you win!")
@Meeeemawwww
@Meeeemawwww 5 жыл бұрын
My assignment for class says I have to use for statements. not while loops
@determinationkaseke
@determinationkaseke 2 жыл бұрын
I appreciate you a lot you made it easy to get it right for me.
@kevinnisbet5648
@kevinnisbet5648 4 жыл бұрын
Here is my code in which i made a list of words and made a function to chose randomly, also has a scoring system. Any feedback would be helpful thanks import random words = ['ant', 'bee', 'cat', 'dog', 'egg', 'hat', 'golf', 'jelly', 'king', 'bird', 'hot', 'cold', 'fish', 'log', 'dad', 'mum', 'goal', 'help', 'frog', 'neat', 'car', 'moon', 'eye', 'tree', 'rice', 'ice', 'speed', 'rat', 'water', 'rain', 'snow', 'spoon', 'light', 'gold', 'zoo', 'oil', 'goat', 'yoga', 'judo', 'japan', 'hello', 'train', 'star', 'start', 'fork', 'teri', 'kevin', 'booker', 'deny', 'dojo', 'code', 'dodge', 'honey'] def choose_random_word(lst): # chooses a word then removes it from the list, to avoid repetition w = random.randrange(len(lst)) return lst.pop(w) def main_loop(): global player_score pick = choose_random_word(words) character_length = len(pick) print(" Round {} - score:{}".format(i, player_score)) print("The word has {} characters".format(character_length)) first_letter = pick[0] last_letter = pick[-1] print("The first letter is {}".format(first_letter.upper())) answer = input("\tEnter your answer: ") tries_count = 3 if answer == pick: print("\tGreat first try! 5 points") player_score += 5 else: print("The last letter is {}".format(last_letter)) while answer != pick and tries_count >= 0: answer = input("Please try again, you have {} tries left: ".format(tries_count)) tries_count -= 1 if character_length > 3: print("Letter {} is {}".format((tries_count+1), pick[tries_count])) if answer == pick: print("good 1 point") player_score += 1 if answer != pick and tries_count < 0: print("\tIncorrect. The correct word was {}".format(pick)) if player_score > 0: player_score -= 1 def print_score(): print(" Your total score was {}".format(player_score)) player_score = 0 times_to_play = 10 for i in range(1, 1 + times_to_play): main_loop() times_to_play += 1 print_score()
@oceansblue692
@oceansblue692 4 жыл бұрын
Your Code is epic & educational. Thanks for sharing. Do you think you can look at my code?
@kevinnisbet5648
@kevinnisbet5648 4 жыл бұрын
@@oceansblue692 Thanks! Sure send it across
@oceansblue692
@oceansblue692 4 жыл бұрын
@@kevinnisbet5648 I did share it in the comments, if you scroll up, you will find it. Much appreciated.
@kevinnisbet5648
@kevinnisbet5648 4 жыл бұрын
@@oceansblue692 Ok, please check,
@leoamine2736
@leoamine2736 5 жыл бұрын
My way of doing it: secret_word = "pyhton" guess = "" guess_count = 0 print("Welcome to our guessing game!") print("Enter a word and see if you guessed the secret one: ") while guess != secret_word and guess_count < 3: guess = input("Enter your guess: ") guess_count += 1 if guess == secret_word: print("That's right! You win.") else: print("Out of guesses! You lose.")
@kkeith49
@kkeith49 4 жыл бұрын
Chiming in here in 2020 using Python 3.3 and I'm getting an error using the "input("Enter a guess: ")". I was only able to get the program to work if I used raw_input vs just input
@tannerabraham4590
@tannerabraham4590 4 жыл бұрын
Try this: kzbin.info/www/bejne/eGKZYpijhbFlnsk
@jaydaoubarbar7452
@jaydaoubarbar7452 2 жыл бұрын
here is my version: secret_word = "carrot" guess = "" attempt = 3 hint = "" yes = "yes" while guess != secret_word and attempt >= 1: attempt -= 1 guess = input("Enter guess: ") if attempt == 1: print("You still have " + str(attempt) + " attempt") hint = input("Do you want a hint? ") if hint == yes: print("it is a vegetable") else: print("okay") elif attempt == 0: print("You have no more attempts!") else: print("You still have " + str(attempt) + " attempts") hint = input("Do you want a hint? ") if hint == yes: print("it is orange in color") else: print("okay") if guess == secret_word: print("You win!") else: print("You lose!")
@Eric-dd8bk
@Eric-dd8bk 3 жыл бұрын
I added a feature that asks the user whether they want to continue or quit when they get the wrong answer to this program and the user can respond by typing "y" or "n" for yes or no. Code below. word = "Giraf" guess = "" guess_count = 0 guess_limit = 2 out_of_guesses = False while guess != word and not out_of_guesses: if guess_count < guess_limit: guess = input("What's the word? ") guess_count += 1 else: out_of_guesses = True print("You lose.") break if guess == "giraf": print("You win!") break else: question = input("Do it again?") if question == 'y': print("One more try!") pass elif question == 'n': print("Okay. Goodbye.") break else: print("Invalid input.") Please let me know if anyone sees any flaws in the code. One possible flaw that I see that might come up is it asking me even when the user is out of guess chances.
@FerriGamingXD
@FerriGamingXD 2 жыл бұрын
This channel is good ilove it!
@bryansanchez8314
@bryansanchez8314 4 жыл бұрын
Thanks like your videos they help me a lot and you explain it so good
@Chirrup...
@Chirrup... 4 жыл бұрын
Thank . I just need to see how to do the loop and break thing
@ahmedmanzar6351
@ahmedmanzar6351 5 жыл бұрын
Hi Mike, In case if the secret_word/title is a book title with more than one word, how to search for a word or few letters using the while loop.
@determinationkaseke
@determinationkaseke 2 жыл бұрын
I got the code correct but my problem is, the phrase 'You won!' keeps appearing even without getting the secret word correct but after getting it correct it appears then no more options just like yours Sir. What binding am I missing
@anxiousearth680
@anxiousearth680 Жыл бұрын
Can you post your code here? I'd like to see.
@nicatgenceliyev3554
@nicatgenceliyev3554 4 жыл бұрын
and it is my opinion: secret_word = "giraffe" guess = "" tries = 3 while guess != secret_word: guess = input("Enter secret word: ") tries -= 1 if tries == 0: print("you lose") break print("you win")
@JackEacher
@JackEacher 2 жыл бұрын
i think you missed "else:" before the "print("you win")"?
@nicatgenceliyev3554
@nicatgenceliyev3554 2 жыл бұрын
@@JackEacher yes you are true
@anandrao2308
@anandrao2308 2 жыл бұрын
secret_word="Test" guess="" trynumber=0 while guess!=secret_word : guess=input("Enter Guess : ") trynumber += 1 if guess!=secret_word: print("You have :" , abs(trynumber-2),"Guess left") #trynumber += 1 if trynumber>=3: #print("break") break if trynumber>=2 and guess!=secret_word: print("Your limit crossed") if guess==secret_word : print("You win ")
@adithyanm9067
@adithyanm9067 6 жыл бұрын
is there any loop like while not in python
@McBoccher
@McBoccher 6 жыл бұрын
while not True while False while 1 == 2
@typeterson8376
@typeterson8376 3 жыл бұрын
Could someone explain why there had to be a global variable for guess with empty quotes. Would it have worked the same if the only variable for guess was the input inside of the whole loop?
@penta5421
@penta5421 3 жыл бұрын
That would not work, as the while loop checks for the guess variable before it is even declared inside the loop. Since the while loop comes before, declaring the variable only inside would give you an error, as the variable does not yet exist.
@typeterson8376
@typeterson8376 3 жыл бұрын
@@penta5421 Thank you sir
@penta5421
@penta5421 3 жыл бұрын
@@typeterson8376 No problem!
@NicoV2
@NicoV2 3 жыл бұрын
thanks for da code now i found my wae of programming :D
@DailyBookInsights
@DailyBookInsights 4 жыл бұрын
#"try again" statement included password="" guess_count=0 guess_limit=5 secret_word="hello" while password!=secret_word and guess_count
@qjz77
@qjz77 5 жыл бұрын
secret = "giraffe" guess = "" guess_limit = 3 while guess != secret and guess_limit > 0 : guess = input("Enter guess") guess_limit -=1 if guess == secret: print("You win.") else: print("You lose.")
@fictionaddiction4706
@fictionaddiction4706 5 жыл бұрын
What's the use of , guess=" " , you said it's to store all guesses . What does that mean? is it only in things with user input? because we haven't done this in the former videos that had user input(mad lib game).
@TheRachana1234
@TheRachana1234 4 жыл бұрын
use a list
@naeemhussain5993
@naeemhussain5993 3 жыл бұрын
Good vid, learnt alot
@asheshgupta4845
@asheshgupta4845 Жыл бұрын
Can someone tell me why we use booleans here?
@duurduranto
@duurduranto 4 жыл бұрын
Much appreciated !!!
@marialilianjemmontero8800
@marialilianjemmontero8800 3 жыл бұрын
hello uh, what software are you using?
@anxiousearth680
@anxiousearth680 Жыл бұрын
For python? Pycharm
@Maldive177
@Maldive177 3 жыл бұрын
instead of the guessing game, password entering may be a better example")....
@StickyDucky
@StickyDucky 4 жыл бұрын
After writing the program, i tried to write down my secret word but need to type it down three times in order for me to "win". why is this so?
@penta5421
@penta5421 3 жыл бұрын
I would love to help, but I'd need to see your code for that
@space9342
@space9342 7 ай бұрын
tried my own before watching the code was functional : no_of_attempts=1 guess_word ="" while no_of_attempts
@overdoseonmynuts
@overdoseonmynuts 6 ай бұрын
what if u wanted the guess word to be more than one word or number?
@im_yule
@im_yule Жыл бұрын
See this guys, I made it in more simple way : # simple guessing game : sec_word = "apple" # secret word chance_left = 3 # chance left for user user_guess = "" # user's guess word while sec_word != user_guess and chance_left != 0: print(">") user_guess = input("Enter your guess word : ") chance_left -= 1 if sec_word == user_guess: print("You are correct, Congratulation You won!") else: print("Finished chance, Sorry you lose! ")
@p.mousumipriyadarshini8677
@p.mousumipriyadarshini8677 4 жыл бұрын
you are very cool dude😎
@aymans.portfolio
@aymans.portfolio 2 жыл бұрын
thanks, sir!
@stametnunukan4137
@stametnunukan4137 4 жыл бұрын
how to answer guess the secret number have six digit code 0-999999, do you have some trick, help please
@tareqalalwan
@tareqalalwan 5 жыл бұрын
My way of doing it :) : password = "Aladdin" answer = "" answer_limit = 3 answer_count = 0 while answer != password and answer_count < answer_limit: answer = input ("Enter your password: ") answer_count += 1 if answer == password: print ("Authorized!") else: print("You are not authorized!")
@gus3301
@gus3301 5 жыл бұрын
what about if you want to set multiple passwords ?
@Ryan_Parmelee
@Ryan_Parmelee 5 жыл бұрын
Here's how I did it. I simplified the code while still maintaining the same functionality. The only difference is I had to use the "break" statement. secretWord = "python" guess = "" guessCount = 0 while guess != secretWord: if guessCount == 3: break else: guess = input("Enter a guess: ") guessCount += 1 if guess == secretWord: print("You Win!") else: print("You Loose!")
@bhanushahi2182
@bhanushahi2182 4 жыл бұрын
Ask the user a question. Read his answer and check if his answer is right or not. If right, say the answer is right. If wrong, prompt him to guess again. He can guess a maximum of 5 times. Before the last guess, give him a “last guess” warning. If he cannot guess within 5 times, display that he/she . can anyone please solve this question?
@JackEacher
@JackEacher 2 жыл бұрын
secret_word = "cat" guess = "" guess_limit = 5 guesses = 0 while guess != secret_word: if guesses < guess_limit: guess = input("Enter a guess: ") guesses += 1 if guesses == 4: guess = input("LAST GUESS! Enter guess: ") guesses += 1 if guess == secret_word: print ("YOU WIN") break else: print ("YOU LOSE") break
@HiruniAbeysekara-fl1ij
@HiruniAbeysekara-fl1ij 4 ай бұрын
@steev708
@steev708 Жыл бұрын
I was not able understand your tutorial fully and i made my own code. But i guess something is wrong, can anyone tell where can i improve secret_word = "Ligma" guess = "" guess_count = 0 guess_limit = 4 while secret_word != guess: guess_count += 1 if guess_count < guess_limit: guess = input("Enter your guess: ") elif guess_count == guess_limit: print("Out of guesses you lose.") if guess == secret_word: print("You win")
@harshitanaik8824
@harshitanaik8824 4 жыл бұрын
Can anyone tell me what should we enter in the guess variable if we want to allow them to enter a number instead of a string . I mean we need to put "" even for numbers or anything else 🤔🤔 I'M REALLY NEW TO THIS!😅😅😅
@CK-bu5wh
@CK-bu5wh 3 жыл бұрын
Int(input(enter a number plz!)) Another way to write/ N= Input(“Enter a number”) Int(n) So the int() function is to convert a string to a integer
@harshitanaik8824
@harshitanaik8824 3 жыл бұрын
@@CK-bu5wh Thank you !🙃
@oceansblue692
@oceansblue692 4 жыл бұрын
Can't resolve the endless loop. it keeps asking "Would you like to play again?" Yes or No is not working properly import random as rd play = True while play: number = rd.randint(1, 20) guess = int(input("Guess a number between 1 and 20: ")) count = 0 while count < guess != number: count +=1 if guess > number: print(guess, "was too high. Try again.") if guess < number: print(guess, "was too low. Try again.") guess = int(input("Guess again!")) print(guess, "was the number! You win!", "well done in ", count, "tries") while True: answer = input('Would you like to play again?: ').lower() if answer == 'Yes': play = True continue # break elif answer == 'No': break else: answer = input('Incorrect option. Type "Yes" to try again or "No" to leave the game').lower()
@kevinnisbet5648
@kevinnisbet5648 4 жыл бұрын
import random as rd def main_game(): play = True while play: number = rd.randint(1, 20) guess = int(input("Guess a number between 1 and 20: ")) count = 0 while count < guess != number: count += 1 if guess > number: print(guess, "was too high. Try again.") if guess < number: print(guess, "was too low. Try again.") guess = int(input("Guess again! ")) print(guess, "was the number! You win!", "well done in", count, "tries") play = False main_game() play_again = True while play_again: answer = input('Would you like to play again?: ').lower() if answer == 'yes': main_game() elif answer == 'no': quit() else: answer = input('Incorrect option. Type "Yes" to try again or "No" to leave the game: ').lower() ------------------------ Im sure there is a better solution but at least it works now :P
@oceansblue692
@oceansblue692 4 жыл бұрын
@@kevinnisbet5648 Brilliant!
@oceansblue692
@oceansblue692 4 жыл бұрын
@@kevinnisbet5648 One more thing, play the game, and instead of typing a guess number, type yes or no, code breaks. Also when the game ends, type in a number instead of yes or no to end the game, and it is still not accepting Yes or no 16 was the number! You win! well done in 6 tries Would you like to play again?: yes Incorrect option. Type "Yes" to try again or "No" to leave the gameYes Would you like to play again?: Yes Incorrect option. Type "Yes" to try again or "No" to leave the game Let's keep trying :)
@kevinnisbet5648
@kevinnisbet5648 4 жыл бұрын
@@oceansblue692 for me the guessing is ok. Guess a number between 1 and 20: 10 10 was too low. Try again. Guess again! 15 15 was the number! You win! well done in 1 tries Would you like to play again?: yes Guess a number between 1 and 20: For me it works fine, if the input is fine. BUT if the code expects a int (number) and gets a char or a string it will cause an error, try using a try/except clause ** also after looking at this maybe start the tries from 1, it took me 2 tries but still says 1 tries. Also maybe use an if statement, if tries < 1 use try else tries .... if that makes sense?
@oceansblue692
@oceansblue692 4 жыл бұрын
@@kevinnisbet5648 Makes sense. Except that i am not that good yet. "using a try/except clause" never used. "an if statement, if tries < 1 use try else tries" Will keep trying. Thanks!
@aartipurandare323
@aartipurandare323 5 жыл бұрын
Hi good one
@ahmedborhan7252
@ahmedborhan7252 3 жыл бұрын
It is not working in phone🥺🥺😣
@BhojrajoO
@BhojrajoO 2 жыл бұрын
🙏
@arturw5390
@arturw5390 3 жыл бұрын
sick..
@fredy749
@fredy749 3 жыл бұрын
I will never win a guess like this as I have never got a clue to answer to the game either guess the name of a wild animal or a tall animal in the world. Just give the user a lead.
@logaprasath8287
@logaprasath8287 2 жыл бұрын
I tried different code. Pls let me know, any flaws in it. secret_word2 = "Surprise" guess1 = "" guess_count = 0 while guess1 != secret_word2 and guess_count < 3 : guess1 = input("Enter guess: ") guess_count += 1 if guess1 == secret_word2 : print ("You win!") elif guess_count < 3 : print("Try again") else : print ("You lose!")
@Dexter21norman
@Dexter21norman 4 жыл бұрын
legend
For Loops | Python | Tutorial 22
8:55
Giraffe Academy
Рет қаралды 37 М.
Building a Translator | Python | Tutorial 25
7:57
Giraffe Academy
Рет қаралды 82 М.
Ozoda - Alamlar (Official Video 2023)
6:22
Ozoda Official
Рет қаралды 10 МЛН
OCCUPIED #shortssprintbrasil
0:37
Natan por Aí
Рет қаралды 131 МЛН
Coding SUCKS for Beginners | Let's Rant!
17:40
Giraffe Academy
Рет қаралды 162 М.
Programming Languages DON'T MATTER | Let's Rant!
10:05
Giraffe Academy
Рет қаралды 44 М.
Return Statement | Python | Tutorial 15
6:15
Giraffe Academy
Рет қаралды 260 М.
Building a better Calculator | Python | Tutorial 18
7:00
Giraffe Academy
Рет қаралды 72 М.
Is JavaScript BAD for Beginners? | Let's Rant
14:53
Giraffe Academy
Рет қаралды 42 М.
Variables & Data Types | Python | Tutorial 5
12:16
Giraffe Academy
Рет қаралды 64 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 298 М.
Classes & Objects | Python | Tutorial 31
14:01
Giraffe Academy
Рет қаралды 38 М.
Exponent Function | Python | Tutorial 23
6:12
Giraffe Academy
Рет қаралды 50 М.
Ozoda - Alamlar (Official Video 2023)
6:22
Ozoda Official
Рет қаралды 10 МЛН