I was wondering how I can take a string input in python and keep working with it. I know how to bypass this problem by choosing an integer instead, but i am curious about it. I found an alternative way for python 2.x with the raw_input() function, but it doesnt exist in python 3.6 anymore (or does it? ). My aim of the function "again" is to restart the whole programm or as an alternative shuts it down.
def again():
question = input("Do you want to start the program again?(Type (yes)or (no))")
or (no))")
if question == "yes"
continue
if question != "yes"
print("Goodbye")
Aucun commentaire:
Enregistrer un commentaire