@@ -9,7 +9,7 @@ class HighSchoolStudent(Student): # Agrega la clase padre dentro de los parént
99 self .specialization = specialization
1010
1111 def study (self , hours ):
12- print ( f " { self .name} is a high school student specializing in { self .specialization} and is studying for { hours} hours for exams. " )
12+ return f " { self .name} is a high school student specializing in { self .specialization} and is studying for { hours} hours for exams. "
1313
1414# Creando una instancia de HighSchoolStudent
1515high_school_student = HighSchoolStudent(" John" , 16 , 85 , " Science" )
@@ -27,13 +27,13 @@ Además, tenemos la flexibilidad de agregar nuevos métodos exclusivamente para
2727
28282 . Agrega un nuevo atributo llamado ` major ` para representar la carrera que están estudiando.
2929
30- 3 . Modifica el método heredado ` introduce ` para imprimir este string:
30+ 3 . Modifica el método heredado ` introduce ` para retornar este string:
3131
3232``` py
3333" Hi there! I'm <name>, a college student majoring in <major>."
3434```
3535
36- 4 . Agrega un nuevo método llamado ` attend_lecture ` que imprima el siguiente string:
36+ 4 . Agrega un nuevo método llamado ` attend_lecture ` que retorne el siguiente string:
3737
3838``` py
3939" <name> is attending a lecture for <major> students."
0 commit comments