questions well answered to pass
What is the output of print?
print('%0.5.1f' % 75.55) - correct answer ✔✔075.5
Write a function call using print_sum() to print the sum of x and 400 (prividing the arguments in that
order). - correct answer ✔✔print_sum(x, 400)
Write a statement that assigns str2 with a copy of str1. - correct answer ✔✔str2 = str1[:]
no spaces between the colon
The statement return a, b, c [c, d] is valid. - correct answer ✔✔True
PV = nRT. Compute the temperature of a gas.
Function convert_to_pres() would likely return (temp * volume) / (mols * gas_constant). - correct answer
✔✔False
Add a return statement to the function that returns the cube of the argument, i.e. (num*num*num).
def cubed(num): - correct answer ✔✔return (num * num * num)
Complete the function definition requiring two arguments arg1 and arg2, and an arbitrary argument list
args.
def f( __blank__):
, # . . . - correct answer ✔✔arg1, arg2, *args
A program can modify the elements of an existing list. - correct answer ✔✔True
What is the output of print?
print('%05d' % 150) - correct answer ✔✔00150
A local variable's scope extends from a function definition's ending colon ":" to the end of the function. -
correct answer ✔✔True
Given the list nums = [[10, 20, 30], [98, 99]], what does nums[0][0] evaluate to? - correct answer ✔✔10
nums[0] returns the list [10, 20, 30]. The 1st element of the list nums[0][0], is 10
Copying and pasting code can lead to common errors if all necessary changes are not made to the pasted
code. - correct answer ✔✔True
Which correctly defines two parameters x and y for a function definition:
def calc_val(. . .):? - correct answer ✔✔(x, y)
Incremental developing may involve more frequent testing, but ultimately leads to faster developing of a
program. - correct answer ✔✔True
Is the following statement invalid?
y = square_root() - correct answer ✔✔False
Given a function definition:
def calc_val(a, b, c): and given variables i, j, k,