Chapter 1: An Intro to Python Programming

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

A console application runs

a. via a command prompt

b. through another application

c. through a browser

d. with a GUI

Answer: through a browser

2
New cards

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

3
New cards

The goal of ________ is to fix all the errors in a program.

a. interpreting

b. editing

c. testing

d. debugging

Answer: testing

4
New cards

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

5
New cards

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: the program crashes and an error message is displayed

6
New cards

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

7
New cards

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

8
New cards

The ________ software for a computer provides the software that's needed for running applications.

a. GUI

b. application

c. systems

d. operation

Answer: systems

9
New cards

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

10
New cards

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

11
New cards

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

12
New cards

A runtime error is also known as

a. a logical error

b. an exception

c. a violation

d. a syntax error

Answer: an exception

13
New cards

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

14
New cards

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

15
New cards

The goal of ______ is to find all the errors in a program

a. debugging

b. interpreting

c. editing

d. testing

Answer: testing

16
New cards

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

17
New cards

Python relies on correct __________ to determine the meaning of a statement.

a. continuation
b. punctuation
c. comments
d. indentation

Answer: indentation

18
New cards

What, if anything, is wrong with this code?
student_score = int(input("Enter this student's score: "))
score = student_score + 5
print("With the 5-point curve, the student's score is ", scores, ".")

a. a string variable is used in an arithmetic expression
b. an undeclared variable name is used in the print() function
c. nothing is wrong with this code
d. the input() function is chained with the int() function

Answer: an undeclared variable name is used in the print() function

19
New cards

What will be the result of the following code if the user enters 81 at the prompt?
score_curve = 7
score = input("Enter your score on the exam: ")
score_curve += score
print(score_curve)

a. error: you cannot print a numeric variable
b. error: you cannot use the += operator to add a string variable to an int value
c. 81 will be displayed on the console
d. 88 will be displayed on the console

Answer: error: you cannot use the += operator to add a string variable to an int value

20
New cards

The data in __________ is persistent so it is not lost when an application ends.

a. the CPU
b. main memory
c. the application software
d. disk storage

Answer: disk storage