Aug-20-2020, 01:56 PM
(This post was last modified: Aug-20-2020, 01:57 PM by pyzyx3qwerty.)
(Aug-18-2020, 03:24 AM)dirtdude Wrote: guess = input("guess a number between 1 and 50 ")If you are aware of for loops and while loops, I'm pretty sure youu would be knowing the answer. However, to help youu to begin with, a while loop is basically a loop that runs until a given condition is satisfied, whereas a for loop is used for iterating over a sequence
guess = int(guess)
if guess == 31:
print("yes!The correct answer is " + str(guess) )
else:
print("wrong,try again ")
this is my code,but I dont know how to loop it,can someone please give suggestions on how to fix it(im a 12 year old kid that just started,so I need some help)
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs