Question: Part 1 Python: Write a program that takes user input for a sequence of reviews for products. The program should ask the user of the
Part 1
Python: Write a program that takes user input for a sequence of reviews for products. The program should ask the user of the product's Name, text review, and star rating (1-5).
Using "For loops", "Function", and "Lists" the program should store each of the above categories in a list. Use proper comments throughout your program and follow appropriate use of variable.
The program should calculate the sentiment for each review
The program should use the statistics library to calculate and then display average, median, mode, standard deviation, minimum, and maximum sentiment and star rating. The printed results should be formatted and aligned.
The program should display relevant message to the user (such as "Enter Name for product no.1". The program should also control for invalid entries. The program should not allow for a review of more than 30 characters long and star ratings outside the 1-5 range.
Please use comments throughout your code and evaluate user input to detect invalid entries.
Part 2
Python: Using the example in Question 1, rewrite part of the program as follows.
1. Write your own function that calculates the average sentiment and average rating ( do not use statist library for calculating the average)
2. Write your own function that calculate the maximum sentiment and average rating (do not use statistic libary for calculating the average)
3. Write your own function that calculate the minimum sentiment and average rating (do not use statistic libary for calculating the average)
4. The rest of the program can remain the same as in q1.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
