Skip to content

Instantly share code, notes, and snippets.

@s1s1ty
Created August 24, 2018 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1s1ty/c5f3e9380281ed30476f9e3ab638231c to your computer and use it in GitHub Desktop.
Save s1s1ty/c5f3e9380281ed30476f9e3ab638231c to your computer and use it in GitHub Desktop.
30-days-python-code
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