Regarding looping inclusion | Sololearn: Learn to code for FREE!


Regarding looping inclusion

class Book: def __init__(self): self.title="""" self.price=0 def read(self): m=input("Enter Title name=") self.title+=m n=input("Enter Author name=") o=int(input("Enter price=")) self.price+=o def display(self): print("Title=",self.title) print("Author=", print("Price=",self.price) s=Book() s.display() ''''''''''''''''''''''''''''''''''''''''''''' I want to ask the user how many number of books he want to enter.My program just results in 1 input.I need multiple inputs from user.So,I need to run a loop.So,please help me in running loop for read function.

10/23/2018 4:48:29 PM

Mohinish Teja

1 Answer

New Answer


#Do you need something like this? for i in range(int(input('How many times?\n'))): s.display()