NEW
Font size
Worksheets2F-1 | Python Quiz #1 | 08.10.2025
Total questions: 20
Worksheet time: 20mins
What does the print() function do in Python?
Takes input from the user
Displays output on the screen
Creates a variable
Stops the program
What type of data does input() return by default?
Integer
Float
String
Boolean
Which of the following is a valid variable name?
2number
first-name
_number
What is the output of print(2 + 3 * 4)?
20
24
14
9
Which operator is used for exponentiation (raising to power)?
^
**
//
%
What is printed by print("Hello", "World", sep="-")?
Hello World
Hello-World
Hello, World
Hello - World
What will print("Hi", end="!") display?
Hi
Hi!
Hi !
!Hi
What is the result of print(7 // 3)?
2
2.3
2.0
3
What is the last digit of num = 345?
3
4
5
0
What will int("10") + 5 return?
15
105
"105"
Error
What will be printed by print(10 % 3)?
3
1
0.3
10
What is the output of this code?
5
6
8
9
Which statement correctly removes the last digit from number 678?
678 / 10
678 // 10
678 % 10
int(678)
What is the output of print(5 // 2, 5 % 2)?
2 1
2.5 1
1 2
2 0
What will happen with this code?
It will print “Hello name”
It will print “Hello” followed by the input
It will show an error
It will print “name Hello”
What is the output of this code?
7 5 4
4 5 7
4 7 5
5 4 7
What will print(2 * (3 + 4) ** 2) output?
49
98
14
70
What is the output of this code?
A B C - D
A*B*C-D
A-B-C-D
ABC D
Given n = 123, print all possible 3-digit rearrangements using digits of n. How many different outputs will there be?
3
4
6
9
What is the output of the following code?
17
8
1
7
