CLASSES AND OBJECT
class Student:
def __init__(self, name, major, gpa, is_on_probation):
self.name = name
self.major = major
self.gpa = gpa
self.is_on_probation = is_on_probation
IN APP.PY FILE
from Student import Student
student1 = Student('Utkarsh', "Business", 9.9, False)
print(student1.name)OUTPUT=utkarsh
Comments
Post a Comment