Question 8
Consider the following Python code snippet:
Python code: “main.py”
import sysmovie_ratings = { "Kalki": [5, 1, 2, 1, 1], "Jailer": [7, 3, 1, 2, 1], "Leo": [4, 3, 2, 2, 1],}
def do_something(movie_name): avg_ratings = {} for movie in movie_ratings: if movie == movie_name: avg_ratings[movie] = sum(movie_ratings[movie]) /len(movie_ratings[movie]) return avg_ratings return "Movie not found"
args = sys.argvprint(do_something(args[1]))The above file will result in the output as “2.8”, for which of the following command line input?
python main.py Kalki
python main.py Leo
python main.py Pushpa2
python main.py Jailer