What is the value of the expression: '5' + '3'?
'5' + '3'
53
Error
8
15
What will the variable 'x' hold after this code executes?
x = 5 x %= 2
2.5
2
1
5
What is the correct way to take integer input from the user in Python?
raw_input()
input(int())
int(input())
input()
What is a lambda function in Python?
A function defined using the 'def' keyword.
A function that recursively calls itself.
A small, anonymous function defined using the 'lambda' keyword.
A function that takes another function as an argument.
What will this code snippet print?
x = 10 if x > 5: if x < 15: print('Yes') else: print('No')
An error message
Yes
No
YesNo
How many times will the following loop iterate?
for i in range(1, 5): print(i)
4
Infinitely
What is the output of the following code?
name = 'Alice' age = 30 print(f'{name} is {age} years old.')
name is age years old.
Alice is 30 years old.
{name} is {age} years old.
How can you retrieve the value associated with the key 'name' in a dictionary named 'my_dict'?
my_dict['name']
my_dict.name
my_dict.get('name')
Both option1 and option3
Which assignment operator in Python is used to perform floor division and assign the result?
=
%=
//=
/=
What will be the output of this code snippet?
i = 0 while i < 5: i += 1 if i == 3: continue print(i)
1 2 4 5
1 2 3 4
0 1 2 4 5
1 2 3 4 5