PFP191_-_RE_-_SU_2023_530.webp
hoanghai90

PFP191_-_RE_-_SU_2023_530.webp

37
(Choose 1 answer)
class Pokemon():
def init (self, name, type):self.name = name
self.type = type
def stringPokemon(self):
print("Pokemon name is (self.name} and type is {self.type}")
class Grass Type(Pokemon):
# overrides the stringPokemon() function on 'Pokemon' class
def stringPokemon(self):
print(f"Grass type pokemon name is {self.name}")
poke1 = Grass Type('Bulbasaur', 'Grass')
poke1.stringPokemon poke1.stringPokemon()
poke2 = Pokemon('Charizard', 'Fire')
poke2.stringPokemon poke2.stringPokemon()
A. Grass type pokemon name is Bulbasaur Pokemon name is Charizard and type is Fire
B. Pokemon name is Bulbasaur and type is Grass Pokemon name is Charizard and type is Fire
C. Grass type pokemon name is Bulbasaur Grass type pokemon name is Charizard
D. Error because the extending class has a stringPokemon() function which already exists.



Thông tin

Category
PFP191
Thêm bởi
hoanghai90
Ngày thêm
Lượt xem
757
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PFP191_-_RE_-_SU_2023_530.webp
File size
73 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom