-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtemp.py
More file actions
31 lines (21 loc) · 771 Bytes
/
temp.py
File metadata and controls
31 lines (21 loc) · 771 Bytes
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
class Anime:
list_of_animes = []
def __init__(self, name, characters):
self.name = name
self.characters = characters
Anime.list_of_animes.append(name)
def introduce(self):
print(f"Hey weebs! We are {self.name}. We have awesome characters: {self.characters} 🔥")
@classmethod
def show_list_and_count_of_animes(cls):
print(f"Animes listed are: {cls.list_of_animes} which sums up to {len(cls.list_of_animes)}")
@staticmethod
def something():
Anime.list_of_animes = "Hello"
one_piece = Anime("one piece", ["Luffy", "Zoro", "Sanji"])
one_piece.introduce()
one_piece.show_list_and_count_of_animes()
one_piece.something()
print(one_piece.list_of_animes)
if __name__ == '__main__':
pass