Write a FaceConnect program that has the ff module:
NOTE: ALL info must be saved in text files.
The ff are the textfiles:
userCredentials - where the data of registered users will be written.
Format:
username;password;firstname;lastname;birthdate
e.g
prettyME;1234;Rhea;Tortor;12/25/1990
Each user has its own textfile where his/her friend(s) info will be written. use the username as the filename of each file.
The content of each file follow below format:
username1;[username2];[username3];
# Define original dictionary
usernames = {'Sammy': 'sammy-shark', 'Jamie': 'mantisshrimp54'}
# Set up while loop to iterate
while True:
# Request user to enter a name
print('Enter a name:')
# Assign to name variable
name = input()
# Check whether name is in the dictionary and print feedback
if name in usernames:
print(usernames[name] + ' is the username of ' + name)
# If the name is not in the dictionary...
else:
# Provide feedback
print('I don\'t have ' + name + '\'s username, what is it?')
# Take in a new username for the associated name
username = input()
# Assign username value to name key
usernames[name] = username
# Print feedback that the data was updated
print('Data updated.')
Comments
Leave a comment