What is the difference between arguments and parameters in Python functions?
Arguments and parameters are interchangeable terms in Python.
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 are the values passed to a function, while parameters are the variables listed in the function definition.
Which method is used to convert a string to uppercase in Python?
toUpperCase()
toUpper()
upper()
uppercase()
What is the correct way to get user input and store it in a variable named 'name'?
name = input('Enter your name:')
name = print('Enter your name:')
print('Enter your name:') = name
input('Enter your name:') = name
How many times will the following loop iterate?
for i in range(1, 5): print(i)
4
5
1
Infinitely
Which of the following is NOT a valid variable name in Python?
variable123
123variable
my_variable
variable_name
What is the correct way to write and run a Python script named 'my_script.py' from the command line?
python run my_script.py
run my_script.py
python my_script.py
execute my_script.py
What is the purpose of the break statement in a loop?
break
It defines a new variable within the loop.
It prints the current value of the loop variable.
It exits the loop entirely.
It skips the current iteration and continues to the next.
Which function is used to convert a string to an integer in Python?
int()
float()
str()
bool()
for i in range(3, 8): print(i)
3
8
7
What will this code snippet print?
x = 10 if x > 5: if x < 15: print('Yes') else: print('No')
YesNo
Yes
No
An error message