What is the output of the following Python code snippet?
print(True and False or True)
Error
None
False
True
What is the maximum number of arguments a lambda function can take?
1
Unlimited
2
255
How many times will the word 'Hello' be printed?
for i in range(3): print('Hello')
3
0
What is the correct way to write and run a Python script named 'my_script.py' from the command line?
python my_script.py
python run my_script.py
execute my_script.py
run my_script.py
What is the difference between arguments and parameters in Python functions?
Arguments are the values passed to a function, while parameters are the variables listed in the function definition.
Arguments are used for input, while parameters are used for output.
Parameters are the values passed to a function, while arguments are the variables listed in the function definition.
Arguments and parameters are interchangeable terms in Python.
What will the following Python code snippet print?
def greet(name): print(f"Hello, {name}!") greet("Alice")
greet("Alice")
Hello, name!
Hello, Alice!
An error message.
Which of the following data structures in Python is mutable?
Tuple
String
List
None of the above
What is the time complexity of checking if an element is present in a Python set?
O(log n)
O(n log n)
O(n)
O(1)
What is the value of the expression: 10 > 5 and 3 < 1?
10 > 5 and 3 < 1
10
Which method is used to add a new key-value pair to a dictionary?
add()
append()
insert()
update()