Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open("user account .txt","w") as userFile:
- usernamePart1 = raw_input("Enter your name:")
- while not usernamePart1.isalpha():
- print("Invalid name, try again")
- usernamePart1 = raw_input("Enter your name:")
- usernamePart2 = raw_input("Enter your age:")
- while not usernamePart2.isdigit():
- print("try again")
- usernamePart2 = raw_input("Enter your age:")
- fullUsername = usernamePart1[:3] + usernamePart2
- userFile.write("Username:" + fullUsername)
- with open("reports.txt","a") as reports:
- reports.write("n" + "Username:" + fullUsername)
- print "Your username is" + " " + (fullUsername)
- UserYearGroup = int(raw_input("Enter your year group:"))
- while UserYearGroup < 7 or UserYearGroup > 15:
- print("Invalid year group, enter again")
- UserYearGroup = int(raw_input("Enter your year group:"))
- if UserYearGroup >= 7 and UserYearGroup <= 14:
- userFile.write("nYear Group:" + str(UserYearGroup))
- print(UserYearGroup)
- password = raw_input("Enter a password which you will remember:")
- userFile.write("nPassword:" + password)
Add Comment
Please, Sign In to add comment