fork download
  1. class BookAmazon:
  2.  
  3. def __init__(self, Name, Title, Author, Price):
  4. self.Name = Name
  5. self.Title = Title
  6. self.Author = Author
  7. self.Price = Price
  8.  
  9. def __str__(self):
  10. return ' Ten {} Title :{} Author :{} Price {} '\
  11. .format(self.Name, self.Title, self.Author, self.Price)
  12.  
  13. def Product_details(self):
  14. self.Paperback = " 474 pages "
  15. self.Publisher = " Packt Publishing - ebooks Account (November 30, 2015) "
  16. self.Language = " English "
  17. self.ISBN_10 = " 1784391913 "
  18. self.ISBN_13 = " 978-1784391911 "
  19. self.Dimensions = " 7.5 x 1.1 x 9.2 inches "
  20. self.Shipping = " 1.8 pounds "
  21. return "{}-{}-{}-{}-{}-{}-{} "\
  22. .format(self.Paperback,self.Publisher,self.Language,self.ISBN_10,self.ISBN_13,self.Dimensions,self.Shipping)
  23. def __Table_of_content__(self):
  24. return "[part1, part2, part3, part4,...]"
  25.  
  26. def __First_Page__(self):
  27. return " Chứa nội dung trang đầu tiên "
  28.  
  29. def Link_book(self):
  30. return "https://w...content-available-to-author-only...n.com/Django-Example-Antonio-Mele/dp/1784391913/"
  31.  
  32. def Link_of_authors(self):
  33. return "https://w...content-available-to-author-only...n.com/s/field-keywords=Antonio+Mele"
  34.  
  35.  
  36. book = BookAmazon("Name", "Title", "Author", 900)
  37.  
  38. print("Use intance method call")
  39. product_details = book.Product_details()
  40. print(product_details)
  41.  
  42. print("Use static method call")
  43. product_details = BookAmazon.Product_details(book)
  44. print(product_details)
Success #stdin #stdout 0.02s 9368KB
stdin
Standard input is empty
stdout
Use intance method call
 474 pages - Packt Publishing - ebooks Account (November 30, 2015) - English - 1784391913 - 978-1784391911 - 7.5 x 1.1 x 9.2 inches - 1.8 pounds  
Use static method call
 474 pages - Packt Publishing - ebooks Account (November 30, 2015) - English - 1784391913 - 978-1784391911 - 7.5 x 1.1 x 9.2 inches - 1.8 pounds