Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu():
- menuchoice = input('''
- 1. Register
- 2. Login
- 3. logout
- >>> ''')
- if menuchoice == '1':
- register()
- elif menuchoice == '2':
- login()
- def register():
- name = input('Enter name: ')
- age = input('Enter age: ')
- favpizza = input('What is your fav pizza?: ')
- letter1 = name [0:3]
- username = letter1 + age
- userFile.write(username + ',')
- userFile = open(username , 'a')
- userFile.write(name + ',')
- userFile.write(age + ',')
- userFile.write(favpizza + ',')
- password = input('Enter password: ')
- password1 = input('Enter password again: ')
- if password != password1:
- print('ERROR AHHHHHH')
- else:
- userFile.write(password + ',')
- print('password accepted! ')
- def login():
- userFile = open('userdetails.txt' , 'r')
- username = input('Enter username: ')
- password = input('Enter password: ')
- filePull = userFile.read().split(',')
- if username in filePull and password in filePull:
- print('YOUR IN! GET IN!')
- else:
- print(' YOU are SHAMEFUL><<><><><><><><><><>')
- menu()
Add Comment
Please, Sign In to add comment