Code: Select all
guess = 0
if guess >= 1:
x = input("pick a number")
else:
try = input("would you like to play again")
if try =="y":
guess = 3
else:
guess = 0Code: Select all
guess = 0
if guess >= 1:
x = input("pick a number")
else:
try = input("would you like to play again")
if try =="y":
guess = 3
else:
guess = 0codenewbie202 wrote: ↑Fri Apr 17, 2020 9:34 pmWhat will be the output of the following lines of code:
Code: Select all
guess = 0 if guess >= 1: x = input("pick a number") else: try = input("would you like to play again") if try =="y": guess = 3 else: guess = 0
would you like to play again
I wouldn't have expected any output, only a syntax error where you have -codenewbie202 wrote: ↑Fri Apr 17, 2020 9:34 pmWhat will be the output of the following lines of code:
hippy wrote: ↑Sat Apr 18, 2020 5:32 pmI wouldn't have expected any output, only a syntax error where you have -codenewbie202 wrote: ↑Fri Apr 17, 2020 9:34 pmWhat will be the output of the following lines of code:
try = input("would you like to play again")
That 'try' is a reserved word, cannot be used as a variable.