What is a key limitation of lambda functions in Python compared to regular functions defined with def?
def
Lambda functions cannot be assigned to variables.
Lambda functions can only take a single argument.
Lambda functions can only contain a single expression.
Lambda functions cannot use the return statement.
return
What is the value of the expression: 10 > 5 and 3 < 1?
10 > 5 and 3 < 1
True
10
False
None
How can you convert the integer 10 to a string in Python?
str(10)
int_to_str(10)
10.to_string()
toString(10)
How many times will the word 'Hello' be printed?
for i in range(3): print('Hello')
0
1
2
3
Which of the following comparison operators means 'not equal to' in Python?
!=
==
<>
=
Which method is used to remove an element from a list by its value in Python?
delete()
pop()
discard()
remove()
Which assignment operator in Python is used to perform floor division and assign the result?
/=
//=
%=
Which of the following is NOT a valid variable name in Python?
variable123
variable_name
my_variable
123variable
Which statement is true about the else block in a while loop?
else
while
It executes only if the loop contains a break statement.
break
It executes only if the loop condition becomes false.
The else keyword cannot be used with a while loop.
It always executes after the loop finishes.
What is the purpose of the '#' symbol in Python code?
To define a variable
To execute a command
To write a comment
To indicate a code block