我正在python 3上做一個程序。我有一個地方,我需要重新啓動腳本。我怎樣才能做到這一點。如何重新啓動我的python 3腳本?
#where i want to restart it
name= input("What do you want the main character to be called?")
gender = input("Are they a boy or girl?")
if gender == "boy":
print("Lets get on with the story.")
elif gender == "girl":
print("lets get on with the story.")
else:
print("Sorry. You cant have that. Type boy or girl.")
#restart the code from start
print("Press any key to exit")
input()
謝謝。這是完美的 –
無後顧之憂,樂意幫忙! –