From 4a85ad1aa9228015d4749fb86bc38b466c940d4b Mon Sep 17 00:00:00 2001 From: jmbharathram <41310420+jmbharathram@users.noreply.github.com> Date: Mon, 20 Jul 2020 00:44:10 -0700 Subject: [PATCH] Create 10_oops_part2.py --- 10_oops_part2.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 10_oops_part2.py diff --git a/10_oops_part2.py b/10_oops_part2.py new file mode 100644 index 0000000..bd29bab --- /dev/null +++ b/10_oops_part2.py @@ -0,0 +1,21 @@ +class Phones: + + def __init__(self, brand, color): + self.brand = brand + self.color = color + + def show_config(self): + print("Color: ", self.color) + print("Brand: ", self.brand) + +class Iphones(Phones): + def __init__(self, brand, color, model): + super().__init__(brand, color) + self.model = model + + def show_config(self): + super().show_config() + print("Model: ", self.model) + +i = Iphones("Apple", "White", "Iphone 11") +i.show_config()