PFP191_-_FE_-_SU_2023_410.webp
N

PFP191_-_FE_-_SU_2023_410.webp

(Choose 1 answer)
class Pokemon():
def init (self, name, type):self.name = name self.type = type
def stringPokemon(self):print("Pokemon ha print(f"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 = GrassType('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.
Exit 12

Thông tin

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

Image metadata

Filename
PFP191_-_FE_-_SU_2023_410.webp
File size
70.6 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom