How to Allow the program below restrict the book prices to a…

Question Answered step-by-step How to Allow the program below restrict the book prices to a…                              How to Allow the program below restrict the book prices to a minimum $100 using pyinputplus like:>>> result = pyip.inputNum(greaterThan=0, lessThan=100)0Input must be greater than 0.50>>> result50 And $ (dollar, integer) and cents (not integers) — (using pyinputplus functions) Image transcription textThis program summarizes a book list. Enter the number of books that you need: 2 Enter the name of the book#1: smonvnos dofinv do Enter the cost of smonvnos dofinv do, to the nearest dollar: Please enter a wholenumber : 32.4 ‘32.4’ is not an integer. Please enter a whole number : 23.4 “23.4′ is not an integer…. Show moreProgram:   import pyinputplus as pyipglobal name_list, price_listname_list = []price_list = []def main(): print(‘This program summarizes a book list.’) num_books, price_list = first_inputs() total, average = processing(price_list) outputs(num_books, price_list, total, average, name_list) restart = pyip.inputYesNo(prompt=’Need more books? Enter y or n: ‘) if restart == ‘yes’: print(‘OK, let’s try a new list.’) main() else: print(‘Thanks for using the program.’)def first_inputs(): num_books = pyip.inputNum(prompt=’Enter the number of books that you need: ‘, min=0) for index in range(num_books): book_name = input_book_name(index) print(f’Enter the cost of {book_name}, to the nearest dollar: ‘) # How to Allow book prices to include $ and cents and restrict to a minimum $100 here book_cost = get_pos_int() book_cost = round(book_cost, 2) price_list.append(book_cost) return num_books, price_listdef get_pos_int(): pos_int = pyip.inputInt(prompt=’Please enter a whole number: ‘, min=0) return pos_intdef input_book_name(index): name = pyip.inputStr(prompt=f’Enter the name of the book #{index + 1}: ‘) name_list.append(name) return namedef processing(price_list): total = sum(price_list) average = total / len(price_list) average = format(average, ‘.2f’) total = format(total, ‘.2f’) return total, averagedef outputs(num_books, price_list, total, average, name_list): print(f’Info on {num_books} Books Needed n’) print(“%-20s %-40s ” % (‘Books’, ‘Price’)) for name in range(len(name_list)): price = format(price_list[name], ‘.2f’) print(“%-20s $ %-40s” % (name_list[name], price)) print() print(f'{“Total”:<20s} $ {total:>5s}’) print(f'{“Average”:<20s} $ {average:>5s}’)main() Computer Science Engineering & Technology Python Programming COMPUTER 50993 Share QuestionEmailCopy link Comments (0)