01/10/2018, 14:15

Các bác cho e hỏi khi e để các tính chất của hàm def Product_details(self) trong init thi lại được mà để riêng thì không được vậy khi minh gọi ra thi không gọi được

class BookAmazon:

def __init__(self, Name, Title, Author, Price):
    self.Name = Name
    self.Title = Title
    self.Author = Author
    self.Price = Price

def __str__(self):
    return ' Ten {}  Title :{} Author :{} Price {} '
           .format(self.Name, self.Title, self.Author, self.Price)

def Product_details(self):
    self.Paperback = " 474 pages "
    self.Publisher = " Packt Publishing - ebooks Account (November 30, 2015) "
    self.Language = " English "
    self.ISBN_10 = " 1784391913 "
    self.ISBN_13 = " 978-1784391911 "
    self.Dimensions = " 7.5 x 1.1 x 9.2 inches "
    self.Shipping =  " 1.8 pounds "
    return "{}-{}-{}-{}-{}-{}-{} "
           .format(self.Paperback,self.Publisher,self.Language,sefl.ISBN_10,self.ISBN_13,self.Dimensions,self.Shipping)
def __Table_of_content__(self):
    return "[part1, part2, part3, part4,...]"

def __First_Page__(self):
    return " Chứa nội dung trang đầu tiên "

def Link_book(self):
    return "https://www.amazon.com/Django-Example-Antonio-Mele/dp/1784391913/"

def Link_of_authors(self):
    return "https://www.amazon.com/s/field-keywords=Antonio+Mele"
Bài liên quan
0