Created
August 24, 2018 18:20
-
-
Save s1s1ty/c5f3e9380281ed30476f9e3ab638231c to your computer and use it in GitHub Desktop.
30-days-python-code
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
from abc import ABCMeta, abstractmethod | |
class Book(object, metaclass=ABCMeta): | |
def __init__(self,title,author): | |
self.title=title | |
self.author=author | |
@abstractmethod | |
def display(): pass | |
class MyBook(Book): | |
def __init__(self, title, author, price): | |
super().__init__(title, author) | |
self.price = price | |
def display(self): | |
print("Title:", self.title) | |
print("Author:", self.author) | |
print("Price:", self.price) | |
title=input() | |
author=input() | |
price=int(input()) | |
new_novel=MyBook(title,author,price) | |
new_novel.display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment