Which of the following is/are true of the print
function?
You’ve seen the len
function a couple times now.
Describe its behavior in terms of its inputs, effects,
and return value.
Which of the following programs will not cause an error when run?
def greet():
print("Hi there!")
greet()
def greet():
print("Hi there!")
greet()def greet():
print("Hi there!")
def greet:
print("Hi there!")
greet()
Consider the following program:
def h2m(hours, minutes):
= 60 * hours + minutes
total_mins return total_mins
= int(sys.argv[1])
arg1 = int(sys.argv[2])
arg2
print(h2m(arg1, arg2))
80
. If the first command line argument was
1
, what must the second one have been?80
. If you don’t know anything about either command
line argument, how many possible pairs of numbers could have been given
as command line arguments?Consider the following program:
def pnmr(n, r):
print(n % r, end=" ")
= 7
size = 3
rad for num in range(0,size):
pnmr(num, rad)