File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
exercises/043-inheritance_and_polymorphism Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class HighSchoolStudent(Student): # Agrega la clase padre dentro de los parént
9
9
self .specialization = specialization
10
10
11
11
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. "
13
13
14
14
# Creando una instancia de HighSchoolStudent
15
15
high_school_student = HighSchoolStudent(" John" , 16 , 85 , " Science" )
@@ -27,13 +27,13 @@ Además, tenemos la flexibilidad de agregar nuevos métodos exclusivamente para
27
27
28
28
2 . Agrega un nuevo atributo llamado ` major ` para representar la carrera que están estudiando.
29
29
30
- 3 . Modifica el método heredado ` introduce ` para imprimir este string:
30
+ 3 . Modifica el método heredado ` introduce ` para retornar este string:
31
31
32
32
``` py
33
33
" Hi there! I'm <name>, a college student majoring in <major>."
34
34
```
35
35
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:
37
37
38
38
``` py
39
39
" <name> is attending a lecture for <major> students."
You can’t perform that action at this time.
0 commit comments