Python looping and program restart if true

后端 未结 3 1724
情歌与酒
情歌与酒 2021-01-27 08:57

Please help as I am a true beginner and would love to learn more. I am trying to learn more about looping so take a look at this code please.

# lets the user inp         


        
3条回答
  •  长情又很酷
    2021-01-27 09:47

    you can try defining a function calc or what ever u want and write the whole code in that function and u can directly call that function whenever u need

    def calc():
     your code
    
    if answer == 'yes' or 'Yes':calc()
    elif answer == 'no' or 'No':print "Thanks for using my calculator
    

提交回复
热议问题