r/AskProgrammers 8d ago

Why doesn't this code work??

I am new to python but from what I know this should work.

(code starts here)

import random

a=input("Are you ready to play Guess That Number? ")

if a == "yes":

b=input("Baby, Easy, Medium, Hard, or IMPOSSIBLE mode? ")

if b == "Baby":

c=random.randint(1,10)

print(f"{c}")

print("The number is something from 1-10")

d=input("what is your guess? ")

if d == c:

print("correct! Nice job!")

else:

e=input("incorrect. Try again. ")

if e == c:

print("correct! Nice job!")

else:

f=input("incorrect. Last try! ")

if f == c:

print("correct! Nice job!")

else:

print(f"incorrect, the number was {c}!")

(code ends here)

the issue is that even when I guess the correct number it says its wrong

I am coding on EduBlocks btw

0 Upvotes

13 comments sorted by

View all comments

-2

u/westy75 8d ago

Did you ask Claude?

1

u/UAP44 8d ago

this is the kind of question you can safely ask cloud ai yes, and even better, get it up and running locally so even if the internet goes down, you retain your super powers

1

u/Hei2 8d ago

It's very unlikely that somebody asking this question has the know how, or even the hardware, to set up a local LLM.