+ 2

Why this code is not run ??

import random w_n=random.randint(1,100) game_over= False n=int(input("inpur number 1 to 100 : ")) g=1 while not game_over : if n==w_n: print (f"you win & you guess {g} time") game_over = True else : if n < w_n: print ("too low") g+=1 n=int(input("guess again: ")) else : print ("too high") g+=1 n=int(input("guess again: "))

7th Feb 2020, 3:10 PM
Jimmy
Jimmy - avatar
2 Answers
+ 1
guess the number is not possible on SL with Python.
7th Feb 2020, 3:23 PM
Oma Falk
Oma Falk - avatar
+ 1
I believe you would have to replace: random.randint(1,100) with: w_n = random.randint(1,100)
7th Feb 2020, 3:13 PM
Jax
Jax - avatar