CPT 168 Final Review Flashcards
The __________ software for a computer provides the software that’s needed for running applications.
systems
The data in __________ is persistent so it is not lost when an application ends.
disk storage
To create a Python program, you use:
IDLE’s editor
The following is an example of \_\_\_\_\_\_\_\_\_\_. print("Hello out there!") # get input name = input("Who are you?") print("Goodbye, " , name)
source code
A console application runs
via a command prompt
The data in __________ is lost when an application ends.
main memory
Python is considered a good first language to learn because:
all of the above
A runtime error is also known as:
an exception
When an exception occurs while a program is running,
the program crashes and an error message is displayed
To run a Python program from IDLE, you use:
the F5 key
The goal of __________ is to fix all the errors in a program.
debugging
To test a Python statement, you use:
IDLE’s interactive shell
Which of the following translates bytecode into instructions for the computer?
the Python virtual machine
A web application runs
through a browser
The following is an example of \_\_\_\_\_\_\_\_\_\_. #!/usr/bin/env python 3
a shebang line
Which type of errors must be fixed before the program can be compiled?
syntax errors
The goal of __________ is to find all the errors in a program.
testing
Given that pi = 3.1415926535, which of the following print() functions displays:
pi = 3.14
print(“pi = “ + str(round(pi, 2)))
Given: x = 23 , y = 15
What is the value of new_num after the following statement executes?
new_num = x % y
8
Given: x = 23 , y = 15
What is the value of new_num after the following statement executes?
new_num = x // y
1
Given: x = 7 , y = 2 , z = 1.5
What is the value of new_num after the following statement executes?
new_num = x / y + z
5.0
Python comments
all of the above
Python relies on correct __________ to determine the meaning of a statement.
indentation
What is the argument of the print() function in the following Python statement?
print(“My student ID is “ + str(123456) )
“My student ID is “ + str(123456)