Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def register():
- global username
- username = raw_input("Enter a username: ").lower()
- firstName = raw_input("Enter your first name: ").lower()
- surname = raw_input("Enter your surname: ").lower()
- age = raw_input("Enter your age: ")
- yearGroup = raw_input("Enter your year group: ")
- with open("users.txt", "a") as usersFile:
- for user in users:
- firstName = user[0]
- surname = user[1]
- age = user[2]
- yearGroup = user[3]
- usersFile.write(firstName + ';' + surname + ';' + age + ';' + yearGroup + ';' + 'n')
- john;doe;13;9;
- mary;smith;14;10;
- with open('users.txt','r') as usersFile:
- usersList=[i.split(",") for i in usersFile.read().replace(" ","").splitlines()]
- results = [str(score), username]
- results.extend(usersList)
- results = [results]
- [[5, mary14, mary, smith, 14, 10][4, john13, john, doe, 13, 9]]
- [['mary;smith;14;10'], [';'], ['john;doe;13;9']]
- [['4', 'john13', ['mary;smith;14;10'], [';'], ['john;doe;13;9']]
Add Comment
Please, Sign In to add comment