Question: For Python 3: you must have the first line: from pmdb import getInfo the function getInfo(n), where n is an integer returns information about an
For Python 3: you must have the first line: from pmdb import getInfo
the function getInfo(n), where n is an integer returns information about an actor in the form: (("Steve"), ("Carell"), (16, "August", 1962), "Actor", ("Concord", "Massachusetts"), ( ( 2019, "Minecraft: The Movie"), ( 2018, "Backseat"), ( 2018, "Welcome to Marwen"), ( 2018, "Beautiful Boy"), ( 2017, "Last Flag Flying"), ( 2017, "Battle of the Sexes") )) 4. the information returned by getInfo is a tuple which has tuples as its elements. 5. write a program that takes two arguments: a. the data structure returned by getInfo, and b. a year 6. the program must ask the user for an integer, and a year. It then calls the function getInfo() with that integer and 7. prints the number of movies in that year for that actor. for example if the data structure returned by getInfo is the previous example and the year is 2019, the number of movies is: 1. If the year is 2018, the number of movies is 3. 8. if the integer entered by the user does not correspond to any actor, getInfo returns the empty tuple () ex:
enter an integer: 0 enter a year: 2014 in 2014 Steve Carell was in 5 movies
enter an integer: 1 enter a year: 2017 in 2017 Alec Baldwin was in 3 movies
enter an integer: 0 enter a year: 2020 in 2020 Steve Carell was not in any movie
------------------------------------------------------------------------------------------
pmdb.py
def getInfo(n):
if n == 0:
return (("Steve"), ("Carell"), (16, "August", 1962),
"Actor", ("Concord", "Massachusetts"),
(
( 2019, "Minecraft: The Movie"),
( 2018, "Backseat"),
( 2018, "Welcome to Marwen"),
( 2018, "Beautiful Boy"),
( 2017, "Last Flag Flying"),
( 2017, "Battle of the Sexes"),
( 2017, "Despicable Me 3"),
( 2016, "Cafe Society"),
( 2015, "The Big Short"),
( 2015, "Freeheld"),
( 2015, "Minions"),
( 2014, "9 Kisses"),
( 2014, "The Tonight Show Starring Jimmy Fallon"),
( 2014, "Alexander and the Terrible, Horrible, No Good, Very Bad Day"),
( 2014, "Foxcatcher"),
( 2014, "Neighbors"),
( 2013, "Panic in the Mailroom"),
( 2013, "Puppy"),
( 2013, "Training Wheels"),
( 2013, "Anchorman 2: The Legend Continues"),
( 2013, "Pharrell Williams: Happy"),
( 2013, "Web Therapy"),
( 2013, "Despicable Me 2: The Music in the Film"),
( 2013, "Despicable Me 2"),
( 2013, "The Incredible Burt Wonderstone"),
( 2013, "The Way, Way Back"),
( 2012, "The Simpsons"),
( 2012, "Hope Springs"),
( 2012, "Despicable Me: Minion Mayhem 3D"),
( 2012, "Seeking a Friend for the End of the World"),
( 2011, "Life's Too Short"),
( 2011, "Crazy, Stupid, Love"),
( 2010, "Dinner for Schmucks"),
( 2010, "Despicable Me"),
( 2010, "Despicable Me"),
( 2010, "Date Night"),
( 2008, "Get Smart"),
( 2008, "Horton Hears a Who"),
( 2007, "Stories USA"),
( 2007, "Dan in Real Life"),
( 2007, "Evan Almighty"),
( 2007, "The Naked Trucker and T-Bones Show"),
( 2006, "Hammy's Boomerang Adventure"),
( 2006, "Over the Hedge"),
( 2006, "American Storage"),
( 2006, "Little Miss Sunshine"),
( 2005, "The 40-Year-Old Virgin"),
( 2005, "Bewitched"),
( 2004, "Wake Up, Ron Burgundy: The Lost Movie"),
( 2004, "Melinda and Melinda"),
( 2004, "Sleepover"),
( 2004, "Anchorman: The Legend of Ron Burgundy"),
( 2004, "Come to Papa"),
( 2004, "Fillmore"),
( 2003, "The Lunchbox Chronicles"),
( 2003, "Bruce Almighty"),
( 2003, "Street of Pain"),
( 2002, "Outlaw Golf"),
( 2000, "H.U.D"),
( 2000, "Strangers with Candy"),
( 1999, "Suits"),
( 1998, "Just Shoot Me"),
( 1998, "Homegrown")
))
elif n == 1:
return (("Alec"),("Baldwin"), (3,"April", 1958),
"Actor", ("Massapequa", "New York"),
(
(2018, "Arctic Justice"),
( 2018, "Mission: Impossible - Fallout"),
( 2018, "Drunk Parents"),
( 2018, "BlacKkKlansman"),
( 2018, "The Looming Tower"),
( 2017, "The Private Life of a Modern Woman"),
( 2017, "Saturday Night Live: Weekend Update Summer Edition"),
( 2017, "The Boss Baby"),
( 2016, "The Curse of Don Scarducci"),
( 2016, "Rules Don't Apply"),
( 2016, "Back in the Day"),
( 2016, "Rachel Dratch's Late Night Snack"),
( 2015, "Concussion"),
( 2015, "Andron"),
( 2015, "Mission: Impossible - Rogue Nation"),
( 2015, "Aloha"),
( 2014, "Torrente 5"),
( 2014, "Still Alice"),
( 2014, "Teachers Lounge"),
( 2014, "Law & Order: Special Victims Unit"),
( 2013, "AmeriQua"),
( 2012, "Rise of the Guardians"),
( 2012, "Rock of Ages"),
( 2012, "Thomas & Friends: Engine Friends"),
( 2012, "To Rome with Love"),
( 2011, "Hick"),
( 2010, "Thomas & Friends: The Greatest Stories"),
( 2009, "It's Complicated"),
( 2009, "My Sister's Keeper"),
( 2009, "World in Conflict: Soviet Assault"),
( 2008, "Madagascar: Escape 2 Africa"),
( 2008, "My Best Friend's Girl"),
( 2008, "Lymelife"),
( 2008, "Thomas & Friends: Mud Glorious Mud"),
( 2007, "Wind"),
( 2007, "World in Conflict"),
( 2007, "Brooklyn Rules"),
( 2007, "Suburban Girl"),
))
else:
return ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
