A. try-except
B. try-catch
C. try-finally
D. catch-finally
Option: A
|
A. try-except
B. try-catch
C. try-finally
D. catch-finally
Option: A
for i in range(5):
if i == 3:
continue
print(i)
A. 0 1 2
B. 0 1 2 4
C. 0 1 2 3
D. 0 1 2 3 4
Option: B
A. Ends the loop immediately
B. Skips the current iteration and moves to the next one
C. Restarts the loop from the beginning
D. Stops the loop after completing the current iteration
Option: B
i = 0
while i < 3:
i += 1
print(i)
A. 0
B. 1
C. 2
D. 3
Option: D
A. exit
B. break
C. continue
D. stop
Option: B
for i in range(3):
print(i)
A. 0 1 2
B. 1 2 3
C. 1 2 3 4
D. 0 1 2 3
Option: A
A. for i in range(5):
B. for (i = 0; i < 5; i++):
C. foreach i in range(5):
D. for i range(5):
Option: A
x = 10
if x > 5:
print(“Greater”)
else:
print(“Smaller”)
A. Greater
B. Smaller
C. Error
D. None
Option: A
A. append()
B. insert()
C. add()
D. update()
Option: D
my_dict = {‘a’: 1, ‘b’: 2}
print(my_dict.get(‘c’, 3))
A. 1
B. 2
C. 3
D. None
Option: C
A. {}
B. dict()
C. []
D. set()
Option: B
set1 = {1, 2, 3}
set2 = {2, 3, 4}
print(set1 & set2)
A. {1, 2, 3, 4}
B. {2, 3}
C. {1, 4}
D. {}
Option: B
A. remove()
B. pop()
C. del
D. All of the above
Option: D
my_tuple = (1, 2, 3, 4)
print(my_tuple[2])
A. 1
B. 2
C. 3
D. 4
Option: C
A. ()
B. []
C. {}
D. <>
Option: A