0 of 30 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Congratulations on completing your quiz!
In Python, a variable must be declared before it is assigned a value:
Which of the following statements assigns the value 100 to the variable x in Python:
What Python built-in function returns the unique number assigned to an object:
Which of the following are true of Python lists?
a = [‘foo’, ‘bar’, ‘baz’, ‘qux’, ‘quux’, ‘corge’]
max(a[2:4] + [‘grault’])
Which displays the correct output?
x = [10, [3.141, 20, [30, ‘baz’, 2.718]], ‘foo’]
Which expression will return ‘z’
a = [1, 2, 3, 4, 5]
Select the statement that removes element 3
a = [‘a’, ‘b’, ‘c’]
All the following statements add ‘d’ and ‘e’ to the end of a, so that it then equals [‘a’, ‘b’, ‘c’, ‘d’, ‘e’] except:
What is the data type of the following variable x = -5j
What is the output of the following code: print(int(2.999))
What is the output of the following code
aTuple = (100, 200, 300, 400, 500)
aTuple[1] = 800
print(aTuple)
What is the output of the following
tuple1 = (1120, ‘a’)
print(max(tuple1))
All the following are true of Python dictionaries except:
d = {‘foo’: 100, ‘bar’: 200, ‘baz’: 300}
What is the result of this statement:
d[‘bar’:’baz’]
Select the all correct way to remove the key marks from a dictionary
student = {
“name”: “Emma”,
“class”: 9,
“marks”: 75
}
What is the output of the following dictionary operation
dict1 = {“name”: “Mike”, “salary”: 8000}
temp = dict1.get(“age”)
print(temp)
In Python, Dictionaries are immutable:
All are correct ways to create an empty dictionary except
What is the output of the following set operation.
set1 = {“Yellow”, “Orange”, “Black”}
set2 = {“Orange”, “Blue”, “Pink”}
set1.difference_update(set2)
print(set1)
What is the output of the following union operation
set1 = {10, 20, 30, 40}
set2 = {50, 20, “10”, 60}
set3 = set1.union(set2)
print(set3)
Which is the correct option to remove “Orange” from this set: sampleSet = {“Yellow”, “Orange”, “Black”}
What is the output of the following set operation:
sampleSet = {“Yellow”, “Orange”, “Black”}
sampleSet.update([“Blue”, “Green”, “Red”])
print(sampleSet)
The union() method returns a new set with all items from both sets by removing duplicates:
All are true about sets except:
The following are comparison operators except:
The following are special operators except:
An if statement will execute if the conditional expression is False:
The following are list methods except:
list_num = [23, 45, 56, 78, 34, 78]
for x in list_num:
print(x)
In the loop statement above, which of the following is the iterator variable?
Python Dictionaries supports looping: