Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
Give this quiz to my class
Q 1/29
Score 0
What will be the output of the following code? `name = input('Enter your name: ') welcome_message = 'Hello, ' + name + '!' print(welcome_message)` if the user enters 'Alice'?
30
Goodbye, Alice!
Welcome to the program!
Hello, Alice
Hello, Alice!
Q 2/29
Score 0
Which of the following variable names is not valid in Python?
30
number2
second_number
2ndNumber
num
29 questions
Q.
What will be the output of the following code? `name = input('Enter your name: ') welcome_message = 'Hello, ' + name + '!' print(welcome_message)` if the user enters 'Alice'?
1
30 sec
Q.
Which of the following variable names is not valid in Python?
2
30 sec
Q.
What is the result of the following expression in Python: `5 * (2 + 3)`?
3
30 sec
Q.
What will be the output of the following code? `x = 10 y = 5 z = x - y print(z)`?
4
30 sec
Q.
What will be the output of the following code? `first_name = 'John' last_name = 'Doe' full_name = first_name + ' ' + last_name print(full_name)`?
5
30 sec
Q.
If a user inputs '3' and '4' for the variables `a` and `b` respectively in the code `a = input('Enter a: ') b = input('Enter b: ') sum = a + b print(sum)`, what will be the output?
6
30 sec
Q.
What will be the result of the following code? `number = 8 print(number // 3)`?
7
30 sec
Q.
What will be the result of the following code snippet? `result = 3 + 4 * 2 print(result)`?
8
30 sec
Q.
What will be the output of the following code? `num1 = input('Enter a number: ') num2 = input('Enter another number: ') total = num1 + num2 print(total)` if the user enters '5' and '10'?
9
30 sec
Q.
What will the following Python code print? x = 'Hello' + ' ' + 'World'; print(x)
10
30 sec
Q.
What is the output of this Python code? age = input('Enter your age: '); print('You are ' + age + ' years old.')
11
30 sec
Q.
What is the result of the following Python code? a = 5; b = 3; c = a * b + a - b; print(c)
12
30 sec
Q.
Which of the following is a valid variable name in Python?
13
30 sec
Q.
What will the following code output if the user inputs '10'? x = input('Enter a number: '); result = int(x) + 5; print(result)
14
30 sec
Q.
What is the output of the following Python code? name = 'Alice'; greeting = 'Hello, ' + name + '!'; print(greeting)
15
30 sec
Q.
What will the following Python code print? number1 = 10; number2 = 4; division_result = number1 / number2; print(division_result)
16
30 sec
Q.
Which of the following statements correctly uses string concatenation in Python?
17
30 sec
Q.
What will be the result of the following code? x = 8; y = 3; z = x % y; print(z)
18
30 sec
Q.
What will the following Python code output? text = 'Python'; duplicate = text * 3; print(duplicate)
19
30 sec
Q.
What will be the output of the following code: name = input('Enter your name: '); greeting = 'Hello, ' + name; print(greeting) if the user enters 'Alice'?
20
30 sec
Q.
Which of the following variable names is invalid in Python?
21
30 sec
Q.
What will the following code output? x = 5; y = 3; result = x * y + 2; print(result)
22
30 sec
Q.
What will be the result of this code snippet? text = 'Python'; length = len(text); print('Length:', length)
23
30 sec
Q.
What will be the output of the following code? text1 = 'Hello'; text2 = 'World'; combined = text1 + ' ' + text2; print(combined)
24
30 sec
Q.
What will the output be for the following code snippet? a = 10; b = 5; c = a - b; print(c * 2)
25
30 sec
Q.
What will be the result of the following code? num1 = 4; num2 = 7; total = num1 + num2 * 2; print(total)
26
30 sec
Q.
What will the output be if the following code runs? user_input = input('Enter a number: '); result = int(user_input) + 5; print(result)
27
30 sec
Q.
Which of the following statements will correctly concatenate the strings 'Welcome' and 'Home' with a space in between?
28
30 sec
Q.
What will be the output of the following code? a = '10'; b = '5'; result = a + b; print(result)