Skip to content

Commit aefbcab

Browse files
authored
Create class.py
1 parent 46efbc5 commit aefbcab

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

codes_in_Aug2025/OOPS/class.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Employee:
2+
age = 19
3+
language = "Python" #class attribute
4+
salary = 1200000
5+
6+
max = Employee()
7+
max.name = "Max" #object attribute or instance attribute
8+
max.language = "Java" #overriding class attribute
9+
# max.name = "Maxwell" #overriding object attribute
10+
print(f"{max.name}\n{max.language}\n{max.age}")
11+
12+
#----instance attributes can override class attributes

0 commit comments

Comments
 (0)