python-kurs-softed/beispiele/personclass1.py

28 lines
354 B
Python
Raw Permalink Normal View History

# personclass1.py
class Person:
name = ""
age = 0
gender = None
person = Person()
print(person)
print(person.__class__)
print(person.name)
print(person.age)
print(person.gender)
person.name = "Joe Doe"
person.age = 32
person.gender = "m"
print(person)
print(person.__class__)
print(person.name)
print(person.age)
print(person.gender)