Hello i have been learning Python 3 and its going in quite well.
But i have a query about classes.
i have the below code
when i run in pycharm, i get the following error
Kind Regards
Rob
But i have a query about classes.
i have the below code
1 2 3 4 5 6 7 8 |
class Student( object ): def __init__( self , name = "Rob" , grade = 'A' , county = "Essex" ): self .name = name self .grade = grade self .county = county student1 = Student() print (student1.name) |
Error: student1 = Student()
NameError: name 'Student' is not defined
can someone point out what im doing wrong please.Kind Regards
Rob