Your task is to write a python program that will create an ID for all the  movies and store it in a dictionary and then print the dictionary. Your

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Suppose you are working as a Software Engineer in an online streaming 
service. You are given the following tuple where all the information of a 
movie is given as [NameOfMove ActorName Actor’sCountry].
my_tuple = ("NoTimeToDie DanielCraige UK", "MissionImpossible TomCruise 
USA", "TopGun TomCruise USA", "Troy BradPitt USA", "Skyfall DanielCraige 
UK", "TheTheoryOfEveryting EddieRedmayne UK", "FantasticBeast EddieRedmayne 
UK", "Seven BradPitt USA")

Your task is to write a python program that will create an ID for all the 
movies and store it in a dictionary and then print the dictionary. Your 
dictionary should be as expected output and while generating the ID ensure 
the following criteria are met. Finally print the dictionary.You do not 
need to take any input. Imagine the input is already given.

For the first digit, if country is UK = 1 and USA = 2
Then, if actor is DanielCraige = 01, TomCruise = 02, BradPitt = 03 and 
EddieRedmayne = 04
Use the tuple’s index number as the last digit.

Expected Output:
{'USA': [('MissionImpossible', 2021), ('TopGun', 2022), ('Troy', 2033), 
('Seven', 2037)], 'UK': [('NoTimeToDie', 1010), ('Skyfall', 1014), 
('TheTheoryOfEveryting', 1045), ('FantasticBeast', 1046)]}

Explanation: ID of MissionImpossible is 2021. This actor is from the USA so 
the first digit is 2, as the actor is TomCruise so 2nd and 3rd digits are 
01 and last digit 1 represents that item is situated at index 1 in the 
my_tuple. You must store the movie name and movie ID in a tuple and save 
that tuple in a list as the value of the dictionary. You Must Store The ID 
as an Integer.

Question 1:
Suppose you are working as a Software Engineer in an online streaming
service. You are given the following tuple where all the information of a
movie is given as [NameOfMove ActorName Actor'sCountryl.
my_tuple = ("No Time ToDie DanielCraige UK", "Missionlmpossible TomCruise
USA", "TopGun TomCruise USA", "Troy BradPitt USA", "Skyfall DanielCraige
UK", "The TheoryOfEveryting EddieRedmayne UK", "FantasticBeast EddieRedmayne
UK", "Seven BradPitt USA")
Your task is to write a python program that will create an ID for all the
movies and store it in a dictionary and then print the dictionary. Your
dictionary should be as expected output and while generating the ID ensure
the following criteria are met. Finally print the dictionary.You do not
need to take any input. Imagine the input is already given.
For the first digit, if country is UK = 1 and USA = 2
Then, if actor is DanielCraige = 01, TomCruise = 02, BradPitt = 03 and
EddieRedmayne = 04
Use the tuple's index number as the last digit.
Expected Output:
{'USA': [('MissionImpossible', 2021), (TopGun', 2022), (Troy', 2033),
('Seven', 2037)], 'UK": [('NoTime ToDie', 1010), ('Skyfall', 1014),
(The TheoryOfEveryting', 1045), (FantasticBeasť, 1046)}
Explanation: ID of MissionImpossible is 2021. This actor is from the USA so
the first digit is 2, as the actor is TomCruise so 2nd and 3rd digits are
01 and last digit 1 represents that item is situated at index 1 in the
my_tuple. You must store the movie name and movie ID in a tuple and save
that tuple in a list as the value of the dictionary. You Must Store The ID
as an Integer.
Transcribed Image Text:Question 1: Suppose you are working as a Software Engineer in an online streaming service. You are given the following tuple where all the information of a movie is given as [NameOfMove ActorName Actor'sCountryl. my_tuple = ("No Time ToDie DanielCraige UK", "Missionlmpossible TomCruise USA", "TopGun TomCruise USA", "Troy BradPitt USA", "Skyfall DanielCraige UK", "The TheoryOfEveryting EddieRedmayne UK", "FantasticBeast EddieRedmayne UK", "Seven BradPitt USA") Your task is to write a python program that will create an ID for all the movies and store it in a dictionary and then print the dictionary. Your dictionary should be as expected output and while generating the ID ensure the following criteria are met. Finally print the dictionary.You do not need to take any input. Imagine the input is already given. For the first digit, if country is UK = 1 and USA = 2 Then, if actor is DanielCraige = 01, TomCruise = 02, BradPitt = 03 and EddieRedmayne = 04 Use the tuple's index number as the last digit. Expected Output: {'USA': [('MissionImpossible', 2021), (TopGun', 2022), (Troy', 2033), ('Seven', 2037)], 'UK": [('NoTime ToDie', 1010), ('Skyfall', 1014), (The TheoryOfEveryting', 1045), (FantasticBeasť, 1046)} Explanation: ID of MissionImpossible is 2021. This actor is from the USA so the first digit is 2, as the actor is TomCruise so 2nd and 3rd digits are 01 and last digit 1 represents that item is situated at index 1 in the my_tuple. You must store the movie name and movie ID in a tuple and save that tuple in a list as the value of the dictionary. You Must Store The ID as an Integer.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY