#1
What does the 'print' function do in Python?
#2
Which of the following is NOT a valid variable name in Python?
#3What is the output of the following code snippet?
What is the output of the following code snippet?
x = 10
y = 5
print(x % y)
#4
Which of the following data types is mutable in Python?
#5What is the output of the following code snippet?
What is the output of the following code snippet?
x = [1, 2, 3]
print(x[1:])
#6
Which of the following statements is used to exit a loop in Python?
#7
What is the result of the following expression in Python: 5 // 2?
#8
Which keyword is used to define a function in Python?
#9What will be the output of the following code snippet?
What will be the output of the following code snippet?
x = 5
y = 2
print(x ** y)
#10
Which of the following is a correct way to open a file named 'data.txt' for writing in Python?
#11What will be the output of the following code snippet?
What will be the output of the following code snippet?
print(3 * '7')
#12
Which of the following is used to comment multiple lines in Python?
#13
What does the 'pass' statement do in Python?
#14
What is the purpose of the 'global' keyword in Python?
#15
What does the 'with' statement do in Python?
#16
Which of the following is true about Python's 'lambda' functions?
#17
What is the purpose of the 'finally' block in Python exception handling?
#18
Which method is used to remove the last element from a list in Python?
#19
Which of the following is NOT a valid way to open a file in Python?
#20
What is the purpose of 'try' and 'except' in Python?
#21What is the output of the following code snippet?
What is the output of the following code snippet?
x = [1, 2, 3]
print(x.pop())
#22What is the output of the following code snippet?
What is the output of the following code snippet?
print(len('Hello'))
#23What is the output of the following code snippet?
What is the output of the following code snippet?
print(10 * 3 + 5 == 35)
#24What is the output of the following code snippet?