A very simple class definition. : Class Define « Class « Python






A very simple class definition.

A very simple class definition.


class Student:
     def __init__ (self, name, age, gender):
         self.name   = name
         self.age    = age
         self.gender = gender
 
s = Student("Your Name", 20, "f")
print s

print s.age


           
       








Related examples in the same category

1.Demonstrates a basic class and objectDemonstrates a basic class and object