I'm trying to see if it's possible to create a loop in a child class with for loop
?
Anyway, here's what I made and trying to figure out how to achieve this (line 22-23) but unfortunately can't find a way. I'm new to python btw and exploring things
class Valkyrie:
def __init__(self, fname, lname):
self.firstname = fname
self.lastname = lname
def printname(self):
print(self.firstname, self.lastname)
class Character(Valkyrie):
def __init__(self, fname, lname, age):
super().__init__(fname, lname)
self.edad = age
def intro(self):
print(self.firstname, self.lastname, self.edad)
def introd(self):
print(self.firstname, self.lastname,",", self.edad)
kk = Character("Kiana", "Kaslana", 16)
for x in kk:
print(x)
rm = Character("Mei", "Raiden", 18)
bz = Character("Bronya", "Zaychick", 14)
kk.intro()
kk.introd()
rm.intro()
bz.intro()