Created
April 10, 2022 16:39
-
-
Save Professor-Sathish/06bb85b1386a73fa37187fa253b29dca to your computer and use it in GitHub Desktop.
Exploring ADTs via Python Snippets - Abstract Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Abstract classes may not be instantiated | |
class A:#Abstract Class | |
def __init__(self,stuname): | |
self.collegename="kite" | |
self.stuname=stuname | |
class B(A): | |
def display(self): | |
print(f"college name {self.collegename}") | |
print(f"student name {self.stuname}") | |
ins=B("raja") | |
ins.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
update