repl.it
@ArjunSS1/

Classes storage

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Person:
  def __init__(self,name,weight,age,height):
    self.name = name
    self.weight = weight
    self.age = age
    self.height = height

class Greet(Person):
  def __init__(self,name,weight,age,height):
    super().__init__(name,weight,age,height)

  def hello(self):
    print("Hello there",self.name)
f = Greet("Arjun",100,14,52)
print(f"{f.name} is {f.age} years old, {f.weight} pounds, and {f.height} inches tall")

f.hello()
f.greeter()
?