Question: 1 . Given the list l = [ 1 , 2 , 3 , 4 , 5 ] , what is the result of l
Given the list l what is the result of l
a
b
c
d Error
How can a tuple t be appended to a list l
a lappendt
b lextendt
c linsert t
d l t
What does the following code snippet output?
for i in range:
if i :
break
printi
a
b
c
d
In the statement names ;joinPedro 'Khan', 'Kara' the variable names is a: a String
b List
c Tuple
d Dictionary
What is the result of type in Python?
a int
b float
c str
d float and int
Which statement about Python lists is true?
a Lists are immutable.
b Lists cannot contain different data types.
c Lists may be ordered and mutable.
d Lists do not allow duplicate elements.
What is the output of the following code?
def funcx y:
return x y
printfunc 'Python'
a PythonPython
b Error
cPython
d Python
Given the following dictionary, which operation will throw an error?
d name: 'John', 'age':
a printdname
b dgender 'male'
c printdgetage
d printdsalary
What does the following function do
def mysteryl:
if lenl:
return l
else:
return l mysteryl:
a Reverses the list
b Removes the last element from the list
c Creates a new list with the last element repeated
d Returns the original list unmodified
What is the result of the following list operation?
nums
vals nums
del vals:
printnums
a
b
c
d Throws an error
What is the output of this code snippet?
def funinp out:
return inp out
printfunout
a b
c d Error
Consider the following code segment:
x
y
printx y
a True b False
c Error d None of the above
What is the final value of x after this code is executed?
x
for in range:
x x
printx
a b
c d
What does the following Python code output?
numbers
sortednumbers sortednumbers reverseTrue
printnumbers sortednumbers
a b
c d
What is the result of the following code?
mylist
printmylist:::
a
b
c
d
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
