PFP191_-_SP_2025_-_RE_3696.webp
Bakugo2001

PFP191_-_SP_2025_-_RE_3696.webp

Kizspy | Question: 1
(Choose 1 answer)
RUBVERT LOW LOM
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 string Pokemon() 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.

Thông tin

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

Share this media

Back
Bên trên Bottom