NEW
Font size
WorksheetsIntro to Python
Total questions: 24
Worksheet time: 12mins
Which operator is used for subtraction in Python
_ (underscore)
* (asterisk)
- (hyphen)
\ (backslash)
Which operator is used for multiplication in Python
# (hash mark)
* (asterisk)
x (x character)
** (double asterisk)
Which operator is used for addition in Python
+ (plus)
# (hash mark)
& (ampersand)
* (asterisk)
Which operator is used for integer division in Python
/ (slash)
% (percent)
^ (caret)
// (double slash)
Which operator is used for exponentiation (to the power of) in Python
^ (caret)
\ (backslash)
** (double asterisk)
* (asterisk)
Which operator is used for remainder when dividing in Python
% (percent)
/ (slash)
// (double slash)
& (ampersand)
Which operator is used for regular division (returns a decimal) in Python
% (percent)
/ (slash)
// (double slash)
\ (backslash)
Which Python function is used to turn any number positive?
round()
abs()
max()
min()
Which Python command would be used to find the square root of 81?
squareroot(81)
sqrt(81)
math.squareroot(81)
math.sqrt(81)
Which is the correct Python command to round the answer of 17 divided by 3 to 2 decimal places?
round(17 // 3, 2)
round(17, 3, 2)
round(17 / 3)
round(17 / 3, 2)
Which of the following is the correct way to write the following math expression:
6+95−2
5 - 2 / (6 + 9)
(5 - 2) / (6 + 9)
(5 - 2) / 6 + 9
5 - 2 / 6 + 9
Which of the following is the correct way to write the following math expression:
7(6−2)
7 6 - 2
7 * 6 - 2
7 * (6 - 2)
7 (6 - 2)
Matthew has a 57 inch string. He wants to know how much he will have left if he cuts the string into as many 14 inch lengths as possible. Which Python expression can be used to figure this out?
57 / 14
57 \ 14
57 % 14
57 // 14
Which of the following Python commands is valid?
print(ABC)
Print("ABC")
print("ABC)
print("ABC")
What will the following Python command output?
print("ABC", 123)
ABC123
ABC 123
"ABC", 123
an error
Which file extension is used when saving Python scripts?
.py
.pyc
.png
.python
Which IDLE mode is used for writing a Python program that can be saved and run later?
file mode
script mode
interactive mode
beast mode
Which IDLE mode is used for running Python commands immediately when the enter key is pressed?
test mode
script mode
interactive mode
beast mode
Python is case sensitive. What does this mean?
Python commands can use either lowercase or uppercase letters.
Python will give a warning when you use the wrong letter case, but will still run the command.
Python commands must be typed exactly as expected, including using whether letters are capitalized or not.
Python breaks down and cries when you talk about it's case.
Which of the following is invalid Python?
print("ABC")
print("123")
print(ABC)
print(123)
What will be the output of the following print command?
print("4 + 5 + 6")
15
4 + 5 + 6
4 + 5 + 6 = 15
there will be an error
Which of the following can be used to print a blank line to the screen.
print()
print("")
Add \n to the end of a print string
All of the Above
What will the following print statement output?
print("lol" * 3)
lollollol
lololol
lol lol lol
there will be an error
Which command must you use to be able to use functions in the math module?
use math
import(math)
import math
None of the Above
