-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchat.py
49 lines (35 loc) · 1.18 KB
/
chat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
class Users:
def __init__(self, username):
self.username = username
self.connected = True
print(username + ' is online')
class Modo:
def __init__(self, username):
self.username = username
self.connected = True
print(username + ' is online')
class Human(Users, Modo):
pass
user1 = Human('user normal')
user2 = Human('modo')
class Messages:
def __init__(self, username):
self.username = username
def say(self, to_say):
print(str(self.username) + ' told: ' + to_say)
class Answers:
def __init__(self, username):
self.username = username
def answer(self, to_say):
print(str(self.username) + ' told: ' + to_say)
class Feed(Answers, Messages):
def say(self, to_say):
return super().say(to_say)
def answer(self, to_say):
return super().answer(to_say)
user = Feed(user1.username)
modo = Feed(user2.username)
user.say(' Hello whats the best programming language?')
modo.answer('All')
user.say('Do you have some coins?')
modo.answer('I will delete your messages is not allowed in this forum')