Questions
Which of the following is the modulo operator?
- *
- %
- \
- #
How would you call the sqrt function from the math module using a generic import?
- sqrt(16)
- module.sqrt(16)
- call.sqrt(16)
- math.sqrt(16)
What would this function output? def value(a, b): return a[:b] print value("Notebook",5)
- ook
- Noteb
- book
- noteb
What is this equal to? min(343, 74, 334, 93)
- 334
- 93
- 74
- 343
What are functions?
- Code that can only be used once in the application
- Reusable pieces of code that can be called on repeatedly.
- A special type of variable
- Indefinite arrays
What is the expression after an if statement always followed by? A...
- semicolon and curly braces
- semicolon and four white spaces on the next code block
- colon and four spaces of white space on the next code block
- colon and two spaces of white space on the next code block
Which of the following statements is true?
- True and False
- False and 5 <= 2 ** 3
- 10 ** 2 > 8 % 1 + 95 and 5 % 3 != 5 / 3
- True and 5 – (10 % 3) <= (2 - 3) * 5
In Python, what data type do comparisons generate?
- Integers
- Floats
- Numbers
- Booleans
Which of the following is true?
- 5*5 > 4+3
- 6-5 < 3-6
- 49 >= 313
- 42 >= 4*10
What correctly imports the datetime library?
- import datetime from datetime
- import from datetime
- from datetime import datetime
- import datetime
If my_variable = "food", what is the data type of my_variable?
- Integer
- Word
- String
- Boolean
What is a correct way of printing the "T" in the string "PYTHON"?
- Print "PYTHON"[2]
- Print "PYTHON"(2)
- Print "PYTHON"[3]
- Print "PYTHON"(3)
Which of the following is the exponent operator?
- $
- ^
- **
- %
What is this variable equal to: addition = 72 + 23
- 85
- 96
- 95
- 97
What is the correct syntax for a multiline comment?
- """This is a multiline comment""""
- #This is a multiline comment""
- <!--This is a multiline comment-->""
- //This is a multiline comment//"