+ 1

I NEED HELP

How do i create a program that randomly shows either Left or Right without stoping? (In Python)

3rd Feb 2018, 2:51 PM
Abass_J1
Abass_J1 - avatar
9 Answers
+ 2
You can use a while statement to infinitely print it! Like: while True: print("left") print("right")
3rd Feb 2018, 3:30 PM
Dread
Dread - avatar
+ 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
3rd Feb 2018, 6:38 PM
Jared
Jared - avatar
+ 1
What...? Expand?
3rd Feb 2018, 3:09 PM
Dread
Dread - avatar
+ 1
Like... Infinitely loop it printing that?
3rd Feb 2018, 3:29 PM
Dread
Dread - avatar
+ 1
Yes
3rd Feb 2018, 3:29 PM
Abass_J1
Abass_J1 - avatar
+ 1
Exactly
3rd Feb 2018, 3:29 PM
Abass_J1
Abass_J1 - avatar
+ 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!
3rd Feb 2018, 3:36 PM
Dread
Dread - avatar
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
3rd Feb 2018, 3:28 PM
Abass_J1
Abass_J1 - avatar
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 🙏
3rd Feb 2018, 3:34 PM
Abass_J1
Abass_J1 - avatar