mardi 30 juin 2015

Why does return statement close the program in python

def settings(data):
    print("1- Show key")
    print("2- Set key")
    key = raw_input()
    if key == "1":
        print("".join(data))
        choose()
    elif key == "2":
        data = list(raw_input())
        return data
        choose()
    else:
        settings(data)

when I run this function, and i choose key == 2 option it lets me insert data but it close the program after.

Aucun commentaire:

Enregistrer un commentaire