+ 1
I NEED HELP
How do i create a program that randomly shows either Left or Right without stoping? (In Python)
9 Answers
+ 2
You can use a while statement to infinitely print it!
Like:
while True:
print("left")
print("right")
+ 3
try this:
import random
ntDone=True
l=âleftâ
r=ârightâ
while(ntDone):
x=random.randint(0,1)
if x==0:
print(l)
else:
print(r)
ntDone=str(input(âCont.? Y/Nâ))
if ntDone==âYâ or ntDone==âyâ:
ntDone=True
else:
ntDone=False
Will only work in computer though
+ 1
What...? Expand?
+ 1
Like... Infinitely loop it printing that?
+ 1
Yes
+ 1
Exactly
+ 1
Slowing it down is something that probably can't be done on SL, because i'd imagine it would incorporate the time.sleep() function; which is broken on SL. đ Good luck!
0
What i mean is when i run the code the output should just randomly either show âLeftâ or âRightâ till i end it. Idk if you get what i mean
0
Yes it works thank you soo much i feel so dumb đđ but now i just have to be able to make it start and stop and slow it down but thanks đ