Skip to content

Commit 37db929

Browse files
authored
Add student_class to solution
1 parent 7cde506 commit 37db929

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Create a class called Student with instance attributes: Name and Age.
2+
# The user can input the Name and Age. Add 2 methods to the class:
3+
# A raiseHand method which prints out the student name followed
4+
# by “is now raising their hand.” A growOlder method that makes the
5+
# student older by 1 year.
6+
7+
class Student:
8+
9+
def __init__(self, name, age):
10+
self.name = name
11+
self.age = age
12+
13+
def raiseHand(self):
14+
print(self.name + " is now raising their hand.")
15+
16+
def growOlder(self):
17+
self.age += 1
18+

0 commit comments

Comments
 (0)