Chapter 1: An Intro to Python Programming
When an exception occurs while a program is running, a. an error message is displayed on the console b. the program crashes and an error message is displayed c. the program crashes d. an error message is displayed but the program continues
Answer:
To create a Python program, you use: a. IDLE's interactive shell b. the command line c. IDLE's editor d. the F5 key
Answer: IDLE's editor
To test a Python statement, you use: a. IDLE's interactive shell b. the command line c. the F5 key d. IDLE's editor
Answer: IDLE's interactive shell
The following is an example of __________. #!/usr/bin/env python 3 a. a shebang line b. Java code c. source code d. bytecode
Answer: a shebang line
Python is considered a good first language to learn because: a. it has most of the features of traditional programming languages b. it is open source c. it has simple syntax d. all of the above
Answer: all of the above
A runtime error is also known as a. a logical error b. an exception c. a violation d. a syntax error
Answer: an exception
The goal of ________ is to fix all the errors in a program. a. interpreting b. editing c. testing d. debugging
Answer: debugging
The data in ______ is persistent so it is not lost when an application ends. a. disk storage b. the application software c. main memory d. the CPU
Answer: disk storage
The data in _____ is lost when an application ends. a. the application software b. the CPU c. disk storage d. main memory
Answer: main memory
The following is an example of __________. print("Hello out there!")# get inputname = input("Who are you?")print("Goodbye, " , name) a. bytecode b. shebang line c. source code d. Java code
Answer: source code
Which type of errors must be fixed before the program can be compiled? a. exceptions b. logical errors c. violations d. syntax errors
Answer: syntax errors
The ________ software for a computer provides the software that's needed for running applications. a. GUI b. application c. systems d. operation
Answer: systems
The goal of ______ is to find all the errors in a program a. debugging b. interpreting c. editing d. testing
Answer: testing
To run a Python program from IDLE, you use: a. the F5 key b. IDLE's interactive shell c. IDLE's editor d. the command line
Answer: the F5 key
Which of the following translates bytecode into instructions for the computer? a. the computer's operating system b. the IDE c. the Python virtual machine d. the Python interpreter
Answer: the Python virtual machine
A web application runs a. via a command prompt b. through another application c. through a browser d. with a GUI
Answer: through a browser
A console application runs a. via a command prompt b. through another application c. through a browser d. with a GUI
Answer: via a command prompt