python - While loop ignores print? -
ok im working on basic dice game, when gets while loop doesnt print message inside, message placeholder.
dicenumber = none numberchoice = none ready = none test = "lol" class playerclass(): points = 0 class enemyclass(): point = 0 def rolldice(): dicenumber = dicenumber.randint(1,9) def start(): print("hello welcome dice game.") print("the goal of game guess number dice land on.") print("the option 1 6 , game won getting 3 points.") print() print("are ready play?") print("1 - yes") print("2 - no") ready = int(input()) start() while ready == 1: print("hello")
use global inside start function. also, trying put while ready==1
, in infinite loop!
dicenumber = none numberchoice = none ready = none test = "lol" class playerclass(): points = 0 class enemyclass(): point = 0 def rolldice(): dicenumber = dicenumber.randint(1,9) def start(): global ready print("hello welcome dice game.") print("the goal of game guess number dice land on.") print("the option 1 6 , game won getting 3 points.") print() print("are ready play?") print("1 - yes") print("2 - no") ready = int(input()) start() while ready == 1: print("hello")
Comments
Post a Comment