The content of data 1.txt file:12,3,5,28,-1,6,496,23,8128,34,55,8,20,22,2,10,11,8128,7,28
Result of the program:
Perfect numbers from the file: [28, 6, 496, 8128, 8128, 28]
Occurrences of each perfect number: (496: 1, 28: 2, 6: 1, 8128: 2)
Number(s) with the highest frequency: 28, 8128
Exercise 3: (4 marks) Write a program that performs the following tasks:
Read book information from a CSV file named book data.csv.
Insert the data into tables of a database named library.sqlite. Ensure that author entries are not duplicated.
- Prompt the user to enter an author's name. The program will then print a list of books by that author. If no books are found for the author, print "No books found for the author."
Content of the input file "book data.csv":
Zoom
+ 85%
Close