Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyMenu
#python 3.6.9 #PyMenu: example of implementing switch in Python #this code is created by Rezaul Hoque on April 07,2022. #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.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; def menu(choice): def setmenu(): s1=f'Default package has 2 parathas, 1 scrambled egg and 1 chai. It costs Tk 50.\n' return s1 def pack1(): s2=f'Package 1 has 2 rotis, 1 dal and 1 coffee. It costs Tk 80.\n' return s2 def pack2(): s3=f'Package 2 has 3 slices of bread, jelly, banana and chai. It costs Tk 40.\n' return s3 def pack3(): s4=f'Package 3 has 1 plate of khichri.It costs Tk 60.\n' return s4 m={ 0: setmenu(), 1: pack1(), 2: pack2(), 3: pack3(), } return m.get(choice, "not defined") if __name__== "__main__": print(" (0)Set Menu (1)Pack1 (2)Pack2 (3)Pack3") choice=int(input("Select\n")) print(menu(choice))
run
|
edit
|
history
|
help
0
Q3
My code 4
Get the longest repeated non-overlapping substring
Guessing game
PyTeleAbs
Play
I_Love_India
Print lists separated by comma
InsertionSort
p1