File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 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.
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+ # 1. A raise_hand method which prints out the student's name followed
4+ # by " is now raising their hand."
5+ # 2. A grow_older method that makes the student older by 1 year.
Original file line number Diff line number Diff line change 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.
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+ # 1. A raise_hand method which prints out the student's name followed
4+ # by " is now raising their hand."
5+ # 2. A grow_older method that makes the student older by 1 year.
66
77
88class Student :
99 def __init__ (self , name , age ):
1010 self .name = name
1111 self .age = age
1212
13- def raiseHand (self ):
13+ def raise_hand (self ):
1414 print (self .name + " is now raising their hand." )
1515
16- def growOlder (self ):
16+ def grow_older (self ):
1717 self .age += 1
You can’t perform that action at this time.
0 commit comments