Sheela is working in a Cyber. Her current task is to create Username and Password for the users and make the list of all the users visiting her Cyber and sort (ascending order) them according to their usernames. And display the list after sorting. If any user exits the cyber then she had to delete that user details by searching them by their usernames. Sheela finds it very difficult to manage the users as many people visit her Cyber. Let's help Sheela by writing code as required to make her work easier. Write a Python code to take the contact details from the user and add the users to the list display it, and sort according to the user name, then display the same. Then Delete the user by searching them through their username. If, no user found with a given name, print “No user found with name ‘username’”. Create a class User in ‘User.py’ with the following attributes, Attribute Data Type name str mobile_number int username str password str Use _init_() constructor to initialize the variables with respect to class. The class ‘User’ contains the following method.   Method Method Description _str() override the __str_() method and display the user details Create a file named Main.py, to drive the above classes. Note: Print all the statements in the Main class.   Input Format: The first line of input is an integer ‘n’ indicating the number of users to be added to the list. Then get the below user details for ‘n’ users → name (str) → mobile number (int) → username (str) → password (str). The last line of input is a username (str), that needs to be deleted. Output format: The Output displays the list of the users before sorting and after sorting, according to the username. If any user is deleted then display the list after deleting the user. Refer to the sample Input and Output formatting specification. [All Texts in bold corresponds to the input and rest are output] Sample Input /Output: Enter the number of User: 2 Enter the details of User 1 Enter the name of the user: John Enter the mobile number of the user: 12345 Enter the username of the user: john Enter the password of the user: john Enter the details of User 2 Enter the name of the user: Joe Enter the mobile number of the user: 67890 Enter the username of the user: joe Enter the password of the user: joe User details as entered: name: John mobileNumber :12345 username: john passsword: john name: Joe mobileNumber: 67890 username: joe passsword: joe After sorting*** name: Joe mobileNumber: 67890 username: joe password: joe name: John mobileNumber: 12345 username: john password: john Enter the user to be deleted: John User named John is successfully deleted after deleting name: Joe mobileNumber: 67890 username: joe password: joe Sample Input and Output 2: Enter the number of User: 3 Enter the details of User 1 Enter the name of the user: abhi Enter the mobile number of the user: 9874563211 Enter the username of the user: Abhishek Enter the password of the user: 999 Enter the details of User 2 Enter the name of the user: Virat Enter the mobile number of the user: 8754612390 Enter the username of the user: virushka Enter the password of the user: 321 Enter the details of User 3 Enter the name of the user: Akash Enter the mobile number of the user: 789654823 Enter the username of the user: akash Enter the password of the user: 741 User details as entered: name: abhi mobileNumber: 9874563211 username: Abhishek password: 999 name: virat mobileNumber: 8754612390 username: virushka password: 321 name: Akash mobileNumber: 789654823 username: akash password: 741 After Sorting*** name: Akash mobileNumber: 789654823 username: akash password: 741 name: abhi mobileNumber: 9874563211 username: Abhishek password: 999 name: virat mobileNumber: 8754612390 username: virushka password: 321 Enter the user to be deleted: raju No user found with name raju

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Sheela is working in a Cyber. Her current task is to create Username and Password for the users and make the list of all the users visiting her Cyber and sort (ascending order) them according to their usernames. And display the list after sorting. If any user exits the cyber then she had to delete that user details by searching them by their usernames. Sheela finds it very difficult to manage the users as many people visit her Cyber. Let's help Sheela by writing code as required to make her work easier.

Write a Python code to take the contact details from the user and add the users to the list display it, and sort according to the user name, then display the same. Then Delete the user by searching them through their username. If, no user found with a given name, print “No user found with name ‘username’”.

Create a class User in ‘User.py’ with the following attributes,

Attribute Data Type
name str
mobile_number int
username str
password str

Use _init_() constructor to initialize the variables with respect to class.
The class ‘User’ contains the following method.

 

Method Method Description
_str() override the __str_() method and display the user details

Create a file named Main.py, to drive the above classes.

Note: Print all the statements in the Main class.

 

Input Format:

The first line of input is an integer ‘n’ indicating the number of users to be added to the list.

Then get the below user details for ‘n’ users

→ name (str)

→ mobile number (int)

→ username (str)

→ password (str).

The last line of input is a username (str), that needs to be deleted.

Output format:
The Output displays the list of the users before sorting and after sorting, according to the username.

If any user is deleted then display the list after deleting the user.

Refer to the sample Input and Output formatting specification.

[All Texts in bold corresponds to the input and rest are output]

Sample Input /Output:

Enter the number of User:

2
Enter the details of User 1
Enter the name of the user:
John
Enter the mobile number of the user:
12345
Enter the username of the user:
john
Enter the password of the user:
john
Enter the details of User 2
Enter the name of the user:
Joe
Enter the mobile number of the user:
67890
Enter the username of the user:
joe
Enter the password of the user:
joe
User details as entered:
name: John
mobileNumber :12345
username: john
passsword: john
name: Joe
mobileNumber: 67890
username: joe
passsword: joe
After sorting***
name: Joe
mobileNumber: 67890
username: joe
password: joe
name: John
mobileNumber: 12345
username: john
password: john
Enter the user to be deleted:
John
User named John is successfully deleted
after deleting
name: Joe
mobileNumber: 67890
username: joe
password: joe

Sample Input and Output 2:
Enter the number of User:
3
Enter the details of User 1
Enter the name of the user:
abhi
Enter the mobile number of the user:
9874563211
Enter the username of the user:
Abhishek
Enter the password of the user:
999
Enter the details of User 2
Enter the name of the user:
Virat
Enter the mobile number of the user:
8754612390
Enter the username of the user:
virushka
Enter the password of the user:
321
Enter the details of User 3
Enter the name of the user:
Akash
Enter the mobile number of the user:
789654823
Enter the username of the user:
akash
Enter the password of the user:
741
User details as entered:
name: abhi
mobileNumber: 9874563211
username: Abhishek
password: 999
name: virat
mobileNumber: 8754612390
username: virushka
password: 321
name: Akash
mobileNumber: 789654823
username: akash
password: 741
After Sorting***
name: Akash
mobileNumber: 789654823
username: akash
password: 741
name: abhi
mobileNumber: 9874563211
username: Abhishek
password: 999
name: virat
mobileNumber: 8754612390
username: virushka
password: 321
Enter the user to be deleted:
raju
No user found with name raju

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY