needs to be in python! THANK YOU!!!!!! Declare a class named PatientData that co
ID: 3762348 • Letter: N
Question
needs to be in python! THANK YOU!!!!!!
Declare a class named PatientData that contains two data members named height_inches and weight_pounds. Sample output for the given program:
GIVEN:
'''Your solution goes here'''
lunaLovegood = PatientData()
print('Patient data (before):', end=' ')
print(lunaLovegood.height_inches, 'in,', end=' ')
print(lunaLovegood.weight_pounds, 'lbs')
lunaLovegood.height_inches = 63
lunaLovegood.weight_pounds = 115
print('Patient data (after):', end=' ')
print(lunaLovegood.height_inches, 'in,', end=' ')
print(lunaLovegood.weight_pounds, 'lbs')
Explanation / Answer
class PatientData:
height_inches=0
weight_pounds=0
lunaLovegood = PatientData()
print('Patient data (before):', end=' ')
print(lunaLovegood.height_inches, 'in,', end=' ')
print(lunaLovegood.weight_pounds, 'lbs')
lunaLovegood.height_inches = 63
lunaLovegood.weight_pounds = 115
print('Patient data (after):', end=' ')
print(lunaLovegood.height_inches, 'in,', end=' ')
print(lunaLovegood.weight_pounds, 'lbs')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.