+ 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
+ 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
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
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