Guess the Number Beginner Python Tutorial

Hello :slight_smile:

New Python learner here.

I am trying to do Kylie Ying’s ‘Guess the Number Beginner Python Tutorial’.

She build two guess the number games. One is human guesses number and the second is the computer guesses the number.

Both games are built within the same code. My code is exactly like hers: guess-the-number/ at master · kying18/guess-the-number · GitHub

However, mine runs differently. When I run the code, unlike Kylie’s video, my code never gets past the first “def” (the first game). While hers runs using the second “def” (the second game).

I am banging my head trying to figure out what is wrong. I’ve even copied and pasted her exact code to test what I was doing wrong - yet I still get the same result.

You define two functions guess and computer_guess, but you only call guess(10). To run the second game you have to call that function with a number: computer_guess(10).


AHHHHHH amazing, thank you !!!

Absolutely correct, and it worked. I’m just so confused why the code works for Kylie Ying which she shows on a YouTube video. How strange

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.