Question
1.) A list contains 12 elements. So ____. the range of indexes is 0 to 11 the range of indexes is 1 to 12 the
1.) A list contains 12 elements. So ____.
the range of indexes is 0 to 11 | ||
the range of indexes is 1 to 12 | ||
the range of indexes is 0 to 12 | ||
the range of indexes is 0 to 13 |
2.) To access the 3rd thing in a dictionary named cars you'd _____
not be able to do this | ||
use cars[3] | ||
use cars[2] | ||
use cars['2'] |
3.) If not all parameters have default values then any default parameters must all go at the end of the parameter list.
True
False
4.)
This is how you unpack a list.
m = [23, 45, 31] m => x, y, z
True
False
5.) A function named calc takes two integer arguments and returns the integer sum. Which of the following is the correct call to the funciton?
total = calc(2, 3) | ||||||||||||||
total = calc() | ||||||||||||||
total = calc(2) | ||||||||||||||
total = calc("2", "3")
6.) How do you search a dictionary named menu for a key but providing a default value in case it is not found?
|
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