Font size
WorksheetsQuiz 2.2
Total questions: 26
Worksheet time: 25mins
if 5 == 10 (a) 4 == 4:
print("At least one of the statements is true")
output is : At least one of the statements is true
fruits = ["apple", "banana", "cherry"]
Use the method to add "orange" to the end of fruits list.
(a)
fruits = ["apple", "banana", "cherry"]
Use the method to add "lemon" as the second item in the fruits list.
(a)
fruits = ["apple", "banana", "cherry"]
Use indexing to print the last item in the list.
(a)
fruits = {"apple", "banana", "cherry"}
more_fruits = ["orange", "mango", "grapes"]
Use the correct method to add multiple items (more_fruits) to the fruits set.
(a)
fruits = {"apple", "banana", "cherry"}
Use the method to add "orange" to the fruits set.
(a)
print(bool("abc"))
(a)
fruits = {"apple", "banana", "cherry"}
Use the method to remove "banana" from the fruits set.
(a)
if 5 > 2: print("Five is greater than two!")
Use the correct short hand syntax to put the following statement on one line:
(a)
t=list((12,7,9))
for i in t: print(i)
if(i==7):
break
(a)
x=[[1,2,3],[4,5,6]]
print(x[0][2])
what is the output of this code?
(a)
x=[[1,2,3],[4,5,6]]
print(x[0])
what is the output of this code?
(a)
x=[[1,2,3],[4,5,6]]
print(x[3])
what is the output of this code?
(a)
x=55;
print(x%2 != 0)
what is the output of this code?
(a)
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
Use the method to print the value of the "model" key of the car dictionary.
(a)
which of the following is not oop concopet?
Encapsulation
inherentiance
polymorphism
exception
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
Change the "year" value from 1964 to 2020.
(a)
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
Use the method to remove "model" from the car dictionary.
(a)
car = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
Use the method to empty the car dictionary.
(a)
def h1(x, y): print(x / y)
h1(x, y)
X/Y
"X/Y"
Error
can we pass to a function an argument ?
True
False
x = lambda a : a + 10 print(x(5))
(a)
sum(1,2,3)
def sum (x,y,z):
print(x+y+z)
What is the output of this code?
(a)
def sum(x:2,z:"5",y:8):
print(x + y + z)
sum(2,8,5)
What is the output of this code?
(a)
def div (x,y):
print(x/y)
div(12,3)
(a)
