Font size
WorksheetsPython Study quiz Test 1
Total questions: 43
Worksheet time: 34mins
____________ is detected by the interpreter.
Syntax Error
Syntax Error
Runtime Error
____________ represents a computation involving values, variables, and operators that, taken together, evaluate to a value.
Statement
Expression
Declaration
What happens if the user enters 5a when executing the following code? radius = float(input("Enter a radius: "))
Value of 5 will be assigned to radius.
It will cause Syntax error.
It will cause an error. You have to enter a numeric value.
The program will run just fine.
is a software that translates python code
(a)
What is not a high-level programming language?
Ada
Python
COBOL
JavaScript
Assembly
is an operating system
(a)
is the physical aspect of the computer that can be seen.
(a)
What is the statement to display the message "Hello world" to the console?
print("hello World")
print("Hello World")
print(Hello World)
Print(Hello World)
Why do computers use zeros and ones?
because binary numbers are simplest.
because combinations of zeros and ones can represent any numbers and characters.
because digital devices have two stable states and it is natural to use one state for 0 and the other for 1.
because binary numbers are the bases upon which all other number systems are built.
is a program that runs on a computer to manage and control a computer's activities.
(a)
____________ are instructions to the computer. Please select all that apply.
Software
Hardware
Programs
Keyboards
The (a) specifies the number of pixels in horizontal and vertical dimensions of the display device.
(a) is the brain of a computer.
(a) errors occur when a program does not perform the way it was intended to.
If you forget to put a closing quotation mark on a string, what kind of error will be raised?
Responses
Logic error
Syntax error
Script error
Runtime error
What is the Python source code filename extension by convention?
.python
.py
.pi
(a) describes how a problem is solved by listing the actions that need to be taken and the order of their executions.
Python source programs are (a) .
(a) translates high-level language program into machine language program.
To run a Python source file from the windows command prompt, the (a) command
To exit Python, type the command (a)
A computer's (a) is volatile; that ism any information stored in it is lost when the system's power is turned off.
Which of the following are storage devices? Please select all that apply.
portable disk
CD-ROM
Flash Stick
hard disk
(a) is the symbol to denote a comment line in Python.
(a) is a device to connect a computer to local area network (LAN).
Can a program written in Python 2 run in Python 3?
(a)
Python is a (a) language, meaning that Python translates each statement and processes it one at a time.
One byte has (a) bits.
Which of the following are the reserved words in Python? Please select all that apply.
all
while
return
with
___________ errors cause python program to terminate abnormally.
Logic
Compiled
Runtime
Syntax
___________ represents a value stored in the computer's memory.
Variable
Class
Definition
Import
Which of the following lines is not a Python comment? Please select all that apply.
/** Comment */
# comments
--comments
"'comments'"
** comments **
(a) is not a n object-oriented programming language.
Show the output for the following line: print("3.5 * 4 / 2 - 2.5")
4.5
NameError
3.5 * 4 / 2 - 2.5
The ____________ statement is one of Python’s built-in functions that can be used to display a string on the console.
write
read
The speed of the CPU may be measured in __________. Please select all that apply.
gigahertz
megahertz
megabytes
gigabytes
If your program needs to read data from a file, but the file does not exist, an error would occur when running this program. What kind of error is this?
Logic
Runtime
Syntax
Programming style is important, because ______________. Please select all that apply.
good programming style helps reduce programming errors
good programming style makes a program more readable
good programming style can make a program run faster
a program may not compile if it has a bad style
____________ is to type a statement at the >>> prompt and to execute it.
Interpreted mode
Script mode
Interactive mode
A program and its data must be moved into the computer's (a) before they can be executed by the CPU.
One gigabyte is approximately ____________ bytes.
1 billion
1 million
1 thousand
1 hundred
CPU understands ____________ language.
machine
assembly
high-level
none of the above
Algorithms can be described in natural languages or in (a) (natural language mixed with some programming code)
