city_name
with a value of Krakow
. The variable city_name
is a reference to an object. Krakow
has object type str because the built-in class str was instantiated in order to create it.class
keywordpass
keyword so the code runs successfully and you can add methods to it later.Student
class and occupy different locations. You can check their memory address as well.student1
and student2
.init method
.self
) as first parameters. The instance is the only parameters that you need to get a student's full name. You can take the logic outside of the class as a return inside the method. You have to use self with each attribute inside the class instead of the instantiated object from the class student3
.full_name
with the Student
classself
parameter for the instance.Student
class. The discount is a good candidate for a class variable.apply_discount
methodNameError
messageStudent.discount_amount
.self
.__dict__
.Student
class.