โ return to practice.dsc10.com
These problems are taken from past quizzes and exams. Work on them
on paper, since the quizzes and exams you take in this
course will also be on paper.
We encourage you to complete these
problems during discussion section. Solutions will be made available
after all discussion sections have concluded. You donโt need to submit
your answers anywhere.
Suppose we have imported the math
module using
import math
. Consider the nested expression below:
int(math.sqrt(math.pow(4 * 2 ** 4, min(9 % 4, 9 / 4, 9 - 4))))
How many function calls are there in this expression? How many arguments does each function have?
What does this expression evaluate to?
After a trip to the zoo, Anthony wrote the following block of code.
= 5
zebra = 4
lion = 1
cow = zebra * 2
zebra = abs(cow - lion)
lion = zebra + lion ** 2
zebra = (zebra + lion) / 2 * lion cow
After running the above block of code, what is the value of
cow
?