Which of the following comparison operators means 'not equal to' in Python?
<>
==
!=
=
What is a lambda function in Python?
A function that takes another function as an argument.
A small, anonymous function defined using the 'lambda' keyword.
A function that recursively calls itself.
A function defined using the 'def' keyword.
What is the output of the following Python code snippet?
print(True and False or True)
False
None
Error
True
How many times will the word 'Hello' be printed?
i = 0 while i < 3: print('Hello') i += 1
2
3
4
Infinitely
Which statement will NOT exit an infinite loop in Python?
break
sys.exit()
return
continue
What will the following code print: print(10 > 5 and 'apple' == 'orange')?
print(10 > 5 and 'apple' == 'orange')
10appleorange
What is the value of the expression: '5' + '3'?
'5' + '3'
53
8
15
What will be the data type of the result of the following expression: 10 / 2?
10 / 2
Float
Boolean
String
Integer
What is the time complexity of checking if an element is present in a Python set?
O(n)
O(1)
O(n log n)
O(log n)
What is the correct way to get user input and store it in a variable named 'name'?
print('Enter your name:') = name
name = input('Enter your name:')
name = print('Enter your name:')
input('Enter your name:') = name