ina works in a consultancy, and she was currently associated with the task where she had to remove the duplicate users from the list by comparing the phone numbers of the users. She thought writing code as per the requirement would make her work easier. So she asks one of her friends, to write a code for her. Imagine you are Tina's friend, help her by writing the code as it is required. Write a Python code to check duplicate user details. There can be only one user with a specific mobile number. If two users exist with the same mobile number they are duplicate. Check whether user information is the same or not by overriding the equals method. Create a User class with the following attributes Attributes Datatype name str username str password str mobile_number int Use _init_() constructor to initialize the variables with respect to class. Override _eq_() method that compares mobile_number of the two objects. Input format : Input consists of 2 user’s details, which contains (name, username, password, mobile_number). Output format : The output is a string value, denoting whether the users were same or not by comparing the mobile number of the user.   [All Texts in bold corresponds to the input and rest are output] Sample Input and Output - 1: Enter the details of User 1 Name : Meena Username : Meena2020 Password : Basic Mobile Number : 1234567890 Enter the details of User 2 Name : Meena Username : Meena1010 Password : Probob Mobile Number : 0987654321 User 1 and User 2 are not equal Sample Input and Output - 2: Enter the details of User 1 Name : Vasu Username : Va450 Password : particles Mobile Number : 9894098490 Enter the details of User 2 Name : Vasu Username : Vasavi Password : 500 Mobile Number : 9894098490 User 1 and User 2 are equal

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

ina works in a consultancy, and she was currently associated with the task where she had to remove the duplicate users from the list by comparing the phone numbers of the users. She thought writing code as per the requirement would make her work easier. So she asks one of her friends, to write a code for her. Imagine you are Tina's friend, help her by writing the code as it is required.

Write a Python code to check duplicate user details. There can be only one user with a specific mobile number. If two users exist with the same mobile number they are duplicate. Check whether user information is the same or not by overriding the equals method.

Create a User class with the following attributes

Attributes Datatype
name str
username str
password str
mobile_number int

Use _init_() constructor to initialize the variables with respect to class.

Override _eq_() method that compares mobile_number of the two objects.

Input format :

Input consists of 2 user’s details, which contains (name, username, password, mobile_number).

Output format :

The output is a string value, denoting whether the users were same or not by comparing the mobile number of the user.

 

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

Sample Input and Output - 1:
Enter the details of User 1
Name :
Meena
Username :
Meena2020
Password :
Basic
Mobile Number :
1234567890
Enter the details of User 2
Name :
Meena
Username :
Meena1010
Password :
Probob
Mobile Number :
0987654321
User 1 and User 2 are not equal

Sample Input and Output - 2:
Enter the details of User 1
Name :
Vasu
Username :
Va450
Password :
particles
Mobile Number :
9894098490
Enter the details of User 2
Name :
Vasu
Username :
Vasavi
Password :
500
Mobile Number :
9894098490
User 1 and User 2 are equal

Expert Solution
steps

Step by step

Solved in 2 steps with 2 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