Answer to Question #302243 in Python for jay

Question #302243

Write a FaceConnect program that has the ff module:

  • script module that'll let the user enter password and username, if username is "X" or "x", program will exit. if username and password are correct, a welcome message and the menu will be displayed. Otherwise, prompt for username and password again. program must perform view, add or delete friend function depend on input.
  • a myLogin module that retrieves the information of the user given username and password.
  • a manageData module that will allow the retrieval, adding and deleting of friend(s).


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];


1
Expert's answer
2022-02-24T08:03:21-0500

# 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.')



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS