Introduction to Problem Solving with Python Textbook Exam Questions - 488 Verified Questions

Page 1


Introduction to Problem Solving with Python Textbook Exam

Questions

Course Introduction

This course introduces students to the fundamental concepts and techniques of problem solving using the Python programming language. Emphasizing logical thinking and algorithmic strategies, the course covers essential programming constructs such as variables, data types, control structures, functions, and basic data structures. Through hands-on exercises and real-world examples, students learn to analyze problems, design solutions, write Python code, and debug programs efficiently. By the end of the course, students will be equipped with the foundational skills necessary to tackle computational problems and build simple applications using Python.

Recommended Textbook

Starting Out with Python 3rd Edition by Tony Gaddis

Available Study Resources on Quizplus 13 Chapters

488 Verified Questions

488 Flashcards

Source URL: https://quizplus.com/study-set/1057 Page 2

Chapter 1: Introduction to Computers and Programming

Available Study Resources on Quizplus for this Chatper

36 Verified Questions

36 Flashcards

Source URL: https://quizplus.com/quiz/20921

Sample Questions

Q1) A(n) _______________ is a set of instructions that a computer follows to perform a task.

Answer: program

Q2) What type of volatile memory is usually used only for temporary storage while running a program?

A) ROM

B) TMM

C) RAM

D) TVM

Answer: C

Q3) A software developer is the person with the training to design, create, and test computer programs.

A)True

B)False

Answer: True

Q4) _______________ is a type of memory that can hold data for long periods of time, even when there is no power to the computer.

Answer: Secondary storage

To view all questions and flashcards with answers, click on the resource link above.

Page 3

Chapter 2: Input, Processing, and Output

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20922

Sample Questions

Q1) The \t escape character causes the output to skip over to the next horizontal tab.

A)True

B)False

Answer: True

Q2) A(n) _______________ is a single task that the program must perform in order to satisfy the customer.

Answer: software requirement

Q3) According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.

A)True

B)False

Answer: False

Q4) Python formats all floating-point numbers to two decimal places when outputting using the print statement.

A)True

B)False

Answer: False

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: Decision Structures and Boolean Logic

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20923

Sample Questions

Q1) When using the _____ operator, one or both subexpressions must be true for the compound expression to be true.

A) Or

B) And

C) Not

D) Maybe

Answer: A

Q2) In a decision structure, the action is _______________ executed because it is performed only when a certain condition is true.

Answer: conditionally

Q3) In flowcharting, the _______________ symbol is used to represent a Boolean expression.

Answer: diamond

Q4) In Python, the _____ symbol is used as the not-equal-to operator.

A) ==

B) <>

C) <=

D) !=

Answer: D

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Repetition Structures

Available Study Resources on Quizplus for this Chatper

34 Verified Questions

34 Flashcards

Source URL: https://quizplus.com/quiz/20924

Sample Questions

Q1) In Python, you would use the _______________ statement to write a count-controlled loop.

Q2) In a nested loop, the inner loop goes through all of its iterations for every single iteration of an outer loop.

A)True

B)False

Q3) Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1,5):

A)True

B)False

Q4) What are the values that the variable num contains through the iterations of the following for loop? For num in range(4)

A) 1, 2, 3, 4

B) 0, 1, 2, 3, 4

C) 1, 2, 3

D) 0, 1, 2, 3

To view all questions and flashcards with answers, click on the resource link above.

Page 6

Chapter 5: Functions and Modules

Available Study Resources on Quizplus for this Chatper

69 Verified Questions

69 Flashcards

Source URL: https://quizplus.com/quiz/20925

Sample Questions

Q1) What type of function can be used to determine whether a number is even or odd?

A) even

B) odd

C) math

D) Boolean

Q2) A(n) _______________ program displays a list of the operations on the screen and allows the user to select the operation that the program should perform.

Q3) The _______________ chart is an effective tool that programmers use for designing and documenting functions.

Q4) A(n) _______________ chart is a visual representation of the relationships between functions.

Q5) Functions in the standard library are stored in files that are known as _______________.

Q6) A(n) _____ variable is created inside a function.

A) global

B) constant

C) defined

D) local

Q7) The code for a function is known as a function _______________.

To view all questions and flashcards with answers, click on the resource link above. Page 7

Chapter 6: Files and Exceptions

Available Study Resources on Quizplus for this Chatper

34 Verified Questions

34 Flashcards

Source URL: https://quizplus.com/quiz/20926

Sample Questions

Q1) An exception handler is a piece of code that is written using the try/except statement.

A)True

B)False

Q2) Which method could be used to strip specific characters from the end of a string?

A) estrip

B) rstrip

C) strip

D) remove

Q3) When a file has been opened using the 'r' mode specifier, which method will return the file's contents as a string?

A) write

B) input

C) get

D) read

Q4) Closing a file disconnects the communication between the file and the program.

A)True

B)False

Q5) A(n) _______________ file contains data that has not been converted to text.

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: Lists and Tuples

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20927

Sample Questions

Q1) Lists are _______________, which means their elements can be changed.

Q2) What are the data items in the list called?

A) data

B) elements

C) items

D) values

Q3) A(n) _______________ is an object that holds multiple items of data.

Q4) Tuples are _______________ sequences, which means that once a tuple is created, it cannot be changed.

Q5) The _______________ method is commonly used to add items to a list.

Q6) In slicing, if the end index specifies a position beyond the end of the list, Python will use the length of the list instead.

A)True

B)False

Q7) Indexing starts at 1, so the index of the first element is 1, the index of the second element is 2, and so forth.

A)True

B)False

Q8) The _______________ method reverses the order of the items in the list.

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: More About Strings

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20928

Sample Questions

Q1) The strip() method returns a copy of the string with all leading whitespace characters removed, but does not remove trailing whitespace characters.

A)True

B)False

Q2) When the operand on the left side of the * symbol is a string and the operand on the right side is an integer, it becomes the _______________ operator.

Q3) If a whole paragraph is included in a single string, the split() method can be used to obtain a list of the sentences included in the paragraph.

A)True

B)False

Q4) If the start index is _____ the end index, the slicing expression will return an empty string.

A) equal to B) less than C) greater than D) not equal to

Q5) The third number in string slicing brackets represents the _______________ value.

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Dictionaries and Sets

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20929

Sample Questions

Q1) The elements in a dictionary are not stored in a specific order. Therefore a dictionary is not a(n) _______________.

Q2) Which of the following does not apply to sets?

A) The stored elements can be of different data types.

B) All the elements must be unique - no two elements can have the same value.

C) The elements are unordered.

D) The elements are pairs.

Q3) The _______________ method clears the contents of a dictionary.

Q4) What would be the result of the following code?

Ages = {'Aaron' : 6, 'Kelly' : 3, 'Abigail' : 1 }

Value = ages['Brianna']

A) false

B) -1

C) 0

D) KeyError

Q5) You would typically use a for loop to iterate over the elements in a set.

A)True

B)False

Q6) Each element in a(n) _______________ has two parts: a key and a value.

To view all questions and flashcards with answers, click on the resource link above. Page 11

Q7) The built-in function _______________ returns the number of items in a set.

Chapter 10: Classes and Object Oriented Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20930

Sample Questions

Q1) Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.

A)True

B)False

Q2) A(n) _______________ method in a class initializes an object's data attributes.

Q3) What is the combining of data and code in a single object known as?

A) Modularity

B) Instantiation

C) Encapsulation

D) Objectification

Q4) Which section in the UML holds the list of the class's methods?

A) First

B) Second

C) Third

D) Fourth

Q5) What attributes belong to a specific instance of the class?

A) Instance

B) Self

C) Object

D) Data

To view all questions and flashcards with answers, click on the resource link above. Page 12

Chapter 11: Inheritance

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20931

Sample Questions

Q1) In a UML diagram depicting inheritance, you only write the name of the subclass.

A)True

B)False

Q2) Which method can you use to determine whether an object is an instance of a class?

A) isinstance

B) isclass

C) isobject

D) isinheritance

Q3) Superclasses are also called _______________ classes.

Q4) One of the ingredients of polymorphic behavior is the ability to define a method in a subclass, and then define a method with the same name in a superclass.

A)True

B)False

Q5) _____ allows a new class to inherit the members of the class it extends.

A) Encapsulation

B) Domain

C) Methods

D) Inheritance

Q6) The term _______________ refers to an object's ability to take different forms.

Page 13

To view all questions and flashcards with answers, click on the resource link above.

Chapter 12: Recursion

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20932

Sample Questions

Q1) Some problems are _______________ solved with recursion than with a loop.

Q2) Recursion is required to solve some type of problems.

A)True

B)False

Q3) Each time a function is called, the system incurs overhead that is not necessary with a loop.

A)True

B)False

Q4) Each time a function is called, the system incurs _______________ that is not necessary with a loop.

Q5) All the cases of the recursive solution other than the base case are called the _______________ case.

Q6) The base case is a case in which the problem can be solved without _____.

A) loops

B) if C) objects

D) recursion

Q7) A base case is not necessary for all recursive algorithms.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 14

Chapter 13: GUI Programming

Available Study Resources on Quizplus for this Chatper

35 Verified Questions

35 Flashcards

Source URL: https://quizplus.com/quiz/20933

Sample Questions

Q1) The _______________ module allows you to create GUI programs in Python.

Q2) What are the items that appear on the graphical interface window called?

A) Buttons

B) Icons

C) Widgets

D) Graphical elements

Q3) The GUI popularized the use of the _______________ as an input device.

Q4) What types of programs are event-driven?

A) GUI programs

B) Command line programs

C) Procedural programs

D) Modular programs

Q5) Which widget will create a rectangular area that can be used to display graphics?

A) Label

B) Frame

C) Canvas

D) Message

Q6) The _______________ widget is used to display text in a window.

To view all questions and flashcards with answers, click on the resource link above. Page 15

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.