def new_user(user): users = raw_input(‘Please type a username’) pass = raw_input(‘Please type a password’) user[users + pass] = 0, 0, 0 #in order: stadiums/levels, cars, coins. def find_user(user) found = “no” users = raw_input(‘Please type a username’) pass = raw_input(‘please type a password’) for key in user: if user[key] == users + pass: found = “yes” print “Welcome back, %s” % (user) if found == “no”: print “You were not found. Please try again or sign up.” log_or_sign() def log_or_sign(): choose = raw_input(‘please type whether you would like to login or sign up.’) print choose if choose == “login” or “log-in” or “log in”: find_user(user) else: new_user(user) #that’s the list of all the players & passwords. they take arguments. log_or_sign()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question