In: Computer Science
Exercise 6 - Oscar nominated movies(Using python to solve it! please)
Write a bot that asks a user what movies they have seen. If they have not seen a movie, it tells them to watch that movie. The user can pick as many names as they want, but they will put all of the names in one input, which means the names will be in a single string rather than a list. Use the following list of movies:
Please find below code and don't forget to give a Like.
Please refer below screenshots for Indentation and output.
Code:
def movies(string1): string1.lower() list1=[] if('once' in string1): list1.append('Once Upon a Time in Hollywood') if('1917' in string1): list1.append('1917') if('little' in string1): list1.append('Little Women') if('joker' in string1): list1.append('Joker') if('jojo' in string1): list1.append('Jojo Rabbit') if('irishman' in string1): list1.append('The Irishman') if('ford' in string1): list1.append('Ford vs Ferarri') if('parasite' in string1): list1.append('Parasite') print("-------------------------------") print("User Entered these movies which are yet to watch:") for i in list1: print(i) list2=['Once Upon a Time in Hollywood','1917','Marriage Story','Little Women', 'Joker','Jojo Rabbit','The Irishman', 'Ford v Ferarri','Parasite'] print("Hello! did you watch from these movies") print("------------------------------------") for i in list2: print(i) print("-------------------------------------") print("If you haven't watched any of the Movie then please watch those movies") movie_string=input("Enter the movie names that are yet to watch:") movies(movie_string)