Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
RandomShape
#Python 2.7.17 #Different shape # demonstration of if-elif-if # #this code is created by Rezaul Hoque on September 22,2021;contact:jewelmrh@yahoo.com ##note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ## import random print "Random shape\n" shape= random.randrange(3) if shape==0: print \ """ ===================== | | | | | | | | ===================== """ elif shape == 1: print \ """ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ # # # # # # # # # # # # # # # # ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ """ elif shape == 2: print \ """ * * * * * * * * * * * * """ else: print "\No shape defined\n" input("\nPress any key to exit")
run
|
edit
|
history
|
help
0
Lists
test
rstring
PyClass
asxsd
single_digit_5
asxsd
PyEnum
Printing
problem on/off