-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path04.py
43 lines (24 loc) · 798 Bytes
/
04.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
class Games:
def __init__ (self, games):
self.games = games
def show_games(self):
if type(self.games) == str:
print (f"I Have One Game Called '{self.games}'")
elif type(self.games) == list:
print(f"I Have Many Games:")
for game in self.games:
print(f"-- {game}")
elif type(self.games) == int:
print (f"I Have {self.games} Game.")
my_game = Games("Shadow Of Mordor")
my_games_names = Games(["Ys II", "Ys Oath In Felghana", "YS Origin"])
my_games_count = Games(80)
my_game.show_games()
# I Have One Game Called 'Shadow Of Mordor'
my_games_names.show_games()
# I Have Many Games:
# -- Ys II
# -- Ys Oath In Felghana
# -- YS Origin
my_games_count.show_games()
# I Have 80 Game.