class book:
def __init__(self):
print("class created")
def input(self):
no_list=[]
fp="book_file.txt"
file=open(fp,"r")
x_list=[]
y_list=[]
while True:
x=(file.readline()).strip("\n")
x_list.append(x)
y=file.readline()
y_list.append(y)
#z=file.readline()
print(x_list)
print(y_list)
b=book()
b.input()
The first three lines of the text file have the number of books, title, and price. After retrieving the values in variables I have to find the cost in method of the class book