Completed the Trivia Quiz Project!

Fix Day 17 README

Add trivia demo
This commit is contained in:
rzmk 2021-08-07 22:29:01 -04:00
parent f462cc5ae0
commit 5f7dcd5629
8 changed files with 157 additions and 3 deletions

View file

@ -0,0 +1,22 @@
class User:
def __init__(self, user_id, username):
self.id = user_id
self.username = username
self.followers = 0
self.following = 0
def follow(self, user):
user.followers += 1
self.following += 1
user_1 = User("001", "mueez")
# user_1.id = "001" # like self.id in init function, but just for this user_1 object if not in init
# user_1.username = "mueez"
user_2 = User("002", "another_user")
user_1.follow(user_2)
print(user_1.followers)
print(user_2.followers)
print(user_1.following)
print(user_2.following)