Classes

#classes - template
#object - instance of the class
#DRY - do not repeat yourself'

class student:
pass

harish=student()
virat=student()

harish.name="harish"
harish.std=12
harish.age=19
harish.school="jnv"

virat.subject=["hindi","math"]
print(harish.name,virat.subject)

Comments

Popular posts from this blog

Steps taken by a compiler to execute a C program

Tokens in C

Variables and Data Types in C