QUESTION IMAGE
Question
dropdown
choose the best collection for each situation.
list
i of the ages of the last 50 customers visit a restaurant. as new customers
een in the list the longest.
deque
tuple
you write a loop to save anywhere from 10 to 100 values from a user. you will pass the collection to a function to find the average.
Lists are mutable sequences in Python. They are suitable for saving a variable - number of values (from 10 to 100 in this case) and can be easily passed to a function for further processing like calculating the average. Deques are more useful for double - ended operations, and tuples are immutable which is not ideal when new values might be added during the loop.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
list