Question: Exercise 5 Computer users' information ID's, user names, surnames, and roles are recorded as a list of strings, as follows serverInfo-id-0;role-admin username-joe;surname-naysmith. surname-suffi;username-sam:role-guest;id-421, id-33;surname-lee:username-mia:role-staff )

 Exercise 5 Computer users' information ID's, user names, surnames, and roles

Exercise 5 Computer users' information ID's, user names, surnames, and roles are recorded as a list of strings, as follows serverInfo-"id-0;role-admin username-joe;surname-naysmith". "surname-suffi;username-sam:role-guest;id-421", "id-33;surname-lee:username-mia:role-staff" ) A "user database" is a dictionary of computer user records: the key will be an ID and the value another (nested) dictionary, which comprises the key/value pairs of the user's info. Write a function that takes server info as input and returns the corresponding "database", as per the db-10: { 'username': "joe", 'surname': "naysmith", 'role': "admin" ) 421:username: "sam", surname: "suffi", 'role': "guest"| ) example below. Hint: Use string functions such as split/partition/join, etc. as needed. 33username': "mia", 'surname': "lee", 'role': "staff, Perform a "database query" that retrieves and print all user names and surnames (all capitalized) as well as their roles Naysmith, Joe - admin Lee, Mia - staff Suffi, Sam - guest Repeat the above "query" but this time users should be printed in ascending order of IID. Note: write a Python program to do the above question, add comments to make the code clearer Exercise 5 Computer users' information ID's, user names, surnames, and roles are recorded as a list of strings, as follows serverInfo-"id-0;role-admin username-joe;surname-naysmith". "surname-suffi;username-sam:role-guest;id-421", "id-33;surname-lee:username-mia:role-staff" ) A "user database" is a dictionary of computer user records: the key will be an ID and the value another (nested) dictionary, which comprises the key/value pairs of the user's info. Write a function that takes server info as input and returns the corresponding "database", as per the db-10: { 'username': "joe", 'surname': "naysmith", 'role': "admin" ) 421:username: "sam", surname: "suffi", 'role': "guest"| ) example below. Hint: Use string functions such as split/partition/join, etc. as needed. 33username': "mia", 'surname': "lee", 'role': "staff, Perform a "database query" that retrieves and print all user names and surnames (all capitalized) as well as their roles Naysmith, Joe - admin Lee, Mia - staff Suffi, Sam - guest Repeat the above "query" but this time users should be printed in ascending order of IID. Note: write a Python program to do the above question, add comments to make the code clearer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!