Skip to content

Update title and sidebarTitle in mcp.mdxS365e5HCK24nPj1/docs#647

Open
S365e5HCK24nPj1 wants to merge 1 commit intoupstash:mainfrom
S365e5HCK24nPj1:patch-1
Open

Update title and sidebarTitle in mcp.mdxS365e5HCK24nPj1/docs#647
S365e5HCK24nPj1 wants to merge 1 commit intoupstash:mainfrom
S365e5HCK24nPj1:patch-1

Conversation

@S365e5HCK24nPj1
Copy link

import random

number = random.randint(1, 20)
guesses = 0

print("Welcome to the Guessing Game!")
print("I'm thinking of a number between 1 and 20.")

while True:
guess = int(input("Take a guess: "))
guesses += 1

if guess < number:
    print("Too low!")
elif guess > number:
    print("Too high!")
else:
    print("Correct! You guessed it in", guesses, "tries.")
    break

import random

number = random.randint(1, 20)
guesses = 0

print("Welcome to the Guessing Game!")
print("I'm thinking of a number between 1 and 20.")

while True:
    guess = int(input("Take a guess: "))
    guesses += 1

    if guess < number:
        print("Too low!")
    elif guess > number:
        print("Too high!")
    else:
        print("Correct! You guessed it in", guesses, "tries.")
        break
@S365e5HCK24nPj1
Copy link
Author

S365e5HCK24nPj1:patch-1

@S365e5HCK24nPj1
Copy link
Author

“Create a short sci-fi story.”
“Make a study schedule for exams.”
“Generate a simple Python game.”
“Write a motivational post.”

@S365e5HCK24nPj1
Copy link
Author

import random

number = random.randint(1, 20)
guesses = 0

print("Welcome to the Guessing Game!")
print("I'm thinking of a number between 1 and 20.")

while True:
guess = int(input("Take a guess: "))
guesses += 1

if guess < number:
    print("Too low!")
elif guess > number:
    print("Too high!")
else:
    print("Correct! You guessed it in", guesses, "tries.")
    break

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant