Python Practical Wee1 Quiz1
Python Practical Wee1 Quiz1
• ( ) x = 10
• ( ) 10 = x
2 Which function is used to take user input in Python?
• ( ) scan()
• ( ) input()
• ( ) read()
• ( ) get_input()
3. Which of the following variable names is valid in Python?
• ( ) 1var
• ( ) _my_var
• ( ) my-var
• ( ) my var
4 What will be the output of the following code?
name = "Alice"
age = 25
print("My name is", name, "and I am", age, "years old.")
10. What will happen if you try to assign a value to a keyword like def in Python?
• ( ) It will store the value successfully.
• ( ) It will throw a SyntaxError
• ( ) It will assign the value but give a warning.
• ( ) It will execute with an unexpected result.
12. What will be the value of x after running the following code?
python
CopyEdit
x = 10
x += 5
• ( ) 10
• ( ) 15
• ()5
• ( ) SyntaxError
14. What is the correct way to declare multiple variables in a single line?
• ( ) x = 5; y = 10; z = 15;
• ( ) x, y, z = 5, 10, 15
• ( ) x = y = z = 5, 10, 15
• ( ) x == 5, y == 10, z == 15