擅长:python、mysql、java
<p>你可以这样试试</p>
<pre><code>def begin():
#code for your begin() function
#by adding restart code here you can restart the function as many times as you want
restart = int(input("Would you like to use the calculator again?\n1: Yes, 2: No\n"))
if restart == 1:
begin()
else:
print("Thank you for using the calculator!")
SystemExit(0) #To exit from the program
if __name__ == '__main__':
begin()
</code></pre>