print "Welcome to the random number generator. Sit back and enjoy numbers one to five in random order!" import random again="y" while again=="y": a=random.randrange(5)+1 b=random.randrange(5)+1 while b==a: b=random.randrange(5)+1 c=random.randrange(5)+1 while c==a or c==b: c=random.randrange(5)+1 d=random.randrange(5)+1 while d==a or d==b or d==c: d=random.randrange(5)+1 e=random.randrange(5)+1 while e==a or e==b or e==c or e==d: e=random.randrange(5)+1 again=raw_input("Again? enter y for again or anything else ro stop.") print "Your random order is:" print a print b print c print d print e
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question