Question: Define a class named StudentInfo that contains the attributes age and id . Initialize age and id with 0 . Click here for example Ex:

Define a class named StudentInfo that contains the attributes age and id. Initialize age and id with 0.
Click here for example
Ex: If the input is:
21
262643
then the output is:
Student info (before): 0 years old, #0
Student info (after): 21 years old, #262643
''' Your code goes here '''
new_student = StudentInfo()
print('Student info (before):', end='')
print(f'{new_student.age} years old,', end='')
print(f'#{new_student.id}')
new_student.age = int(input())
new_student.id = int(input())
print('Student info (after):', end='')
print(f'{new_student.age} years old,', end='')
print(f'#{new_student.id}')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!