Answered step by step
Verified Expert Solution
Question
1 Approved Answer
for the q4 I already solve #3, I need to know how to solve the factorial by list comprehensions. AND Q5 THANKS 4. Modify the
for the q4 I already solve #3, I need to know how to solve the factorial by list comprehensions.
AND Q5
THANKS
4. Modify the program above using a while loop so it prints out all of the factorial values that are less than 1 billion. (You should be able to do this without looking at the output of the previous exercise.) 1. Repeat #3 above using list comprehensions. Please see these increasingly more sophisticated references for list comprehensions: Simple, Advanced, Complex (has a hint for this problem). 5. Suppose you have a dictionary of dictionaries, or a 2D dictionary, called banditos as follows: alonzo = {"age": 10, "height": 42, "weight": 175, "instrument":"fddle" } turing = {"age" : 41, "height": 70, "weight": 160, "instrument": "theremin") bertha = {"age" : 32, "height": 97, "weight": 587, "instrument": "cello"} tinkerB = {"age":100, "height": 4, "weight": 0.5, "instrument": "cello") banditos = {"Alonzo": alonzo, "Turing": turing, "Bertha": bertha, "TinkerB": tinkerb} We can access the sub-dictionary, or vector, of Alonzo's attributes as follows: banditos["Alonzo"] {"age": 10,"height": 42, "weight": 175, "instrument ": "fiddle" } We can also return a specific feature of Alonzo's as: banditos[ "Alonzo" lage" ] 10 For the above dictionary, banditos, write a function that, when given the dictionary, returns a list of users who play a certain instrument. E.g., here's a sample run and its result: find_players (banditos, "cello") [ "Bertha", "TinkerB"]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started