What is the output ? def fun(n): while n%10!=0: n//=10 return n print( fun(1023045) ) a. 1 b. 10 c. 102 d. 10230 Suppose
Posted: Fri Jun 10, 2022 11:55 am
What is the output ?
def fun(n): while n%10!=0: n//=10 return n print( fun(1023045)
)
a. 1
b. 10
c. 102
d. 10230
Suppose that d = {1:2, 3:4}.
Which of the following lines causes an error?
d[[1,2]] = (1,2) d[(1,2)] = [1,2]
a. neither cause an error
b. only d[[1,2]] = (1,2)causes an error
c. only d[(1,2)] = [1,2]causes an error
d. both lines cause an error
What is the output ?
d = {'a':2, 'b':3, 'c':4} print( 4 in d, 'b' in d)
a. False False
b. True False
c. False True
d. True True
def fun(n): while n%10!=0: n//=10 return n print( fun(1023045)
)
a. 1
b. 10
c. 102
d. 10230
Suppose that d = {1:2, 3:4}.
Which of the following lines causes an error?
d[[1,2]] = (1,2) d[(1,2)] = [1,2]
a. neither cause an error
b. only d[[1,2]] = (1,2)causes an error
c. only d[(1,2)] = [1,2]causes an error
d. both lines cause an error
What is the output ?
d = {'a':2, 'b':3, 'c':4} print( 4 in d, 'b' in d)
a. False False
b. True False
c. False True
d. True True