Answer to Question #268651 in Python for lol

Question #268651

class User :

def __int__(self, user_id, username):

self.id = user_id

self.username = username


user_1 = User("001", "allobang")

print(user_1.username)

user_2 = User("002", "Jack")

print(user_2.username)


ACTIVITIES:

1. Finish this code by adding a password attribute.

2. Assign passwords on user_1 and user_2 of your choice.

3. Create 3rd user object.

a. The value of the id should be your student ID number.

b. The value of username should be your first name.

c. Assign the value of the password attribute of your choice.

4. Print the username of 3rd user object.


1
Expert's answer
2021-11-20T06:45:06-0500
class User:

def __init__(self, user_id, username, passwd):

self.id = user_id

self.username = username

self.passwd = passwd

user_1 = User('001', 'allobang', '12345678')

print(user_1.username)

user_2 = User('002', 'Jack', '87654321')

print(user_2.username)

user_3 = User('003', 'Your first name', 'password')

print(user_3.username)

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