Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 167 páginas
Examen

Complete Solutions Manual & Answer Guide — Fundamentals of Python: First Programs, 3rd Edition — Kenneth A. Lambert, 2021 — ISBN 9780357881019 — All Chapters Covered 1–13 (Latest Update)

Document preview thumbnail
Vista previa 4 fuera de 167 páginas

This verified Solutions Manual & Answer Guide for Fundamentals of Python: First Programs (3rd Edition) by Kenneth A. Lambert (published 2021, ISBN 9780357881019) offers fully worked solutions and annotated code examples for every chapter in the textbook. Designed for introductory programming courses, the guide supports instructors and learners through Python’s core concepts, from foundational syntax to data visualization, object-oriented design, and multithreading. The official chapter sequence begins with Chapter 1: Introduction, followed by Chapter 2: Software Development, Data Types, and Expressions, Chapter 3: Loops and Selection Statements, Chapter 4: Strings and Text Files, Chapter 5: Lists and Dictionaries, and Chapter 6: Design with Functions. The midsection continues with Chapter 7: Design with Recursion, Chapter 8: Simple Graphics and Image Processing, and Chapter 9: Graphical User Interfaces. Advanced topics are addressed in Chapter 10: Design with Classes, Chapter 11: Data Analysis and Visualization, Chapter 12: Multithreading, Networks, and Client/Server Programming, and Chapter 13: Searching, Sorting, and Complexity Analysis.

Vista previa del contenido

Solution and Answer Guide For All Chapters: Lambert, Fundamentals of Python: First Programs, 3e, CY24, 9780357881019; Chapter 1, Introduction
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution and Answer Guide For All Chapters x3 x3 x3 x3 x3 x3




LAMBERT, FUNDAMENTALS OF PYTHON: FIRST PROGRAMS, 3E, CY24, 9780357881019; CHAPTER 1,
X3 X 3 X 3 X3 X 3 X3 X3 X3 X3 X 3




INTRODUCTION
X3




TABLE OF CONTENTS X3 X3




Exercise Solutions ...................................................................................................................................... 1
x3




Exercise 1.1 ............................................................................................................................................. 1
x3




Exercise 1.2 ............................................................................................................................................. 2
x3




Exercise 1.3 ............................................................................................................................................. 3
x3




Review Questions Answers........................................................................................................................ 4
x3 x3




Programming Exercises Solutions ............................................................................................................ 8
x3 x3




Debugging Exercises Solutions.................................................................................................................. 8
x3 x3




EXERCISE SOLUTIONS X3




EXERCISE 1.1 X3




1. List three common types of computing agents.
x3 x3 x3 x3 x3 x3




Solution:

Human beings, desktop computers, cell phones x3 x3 x3 x3 x3




2. Write an algorithm that describes the second part of the process of making change (counting out the coins
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




and bills).
x3 x3




Solution:

There are various ways to do this, but here is one:
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Repeat
Select the largest unit of money that is less than or equal to the remaining change
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Subtract this unit from the remaining change
x3 x3 x3 x3 x3 x3 x3




Until the remaining change is 0 x3 x3 x3 x3 x3




The collection of units selected represent the change
x3 x3 x3 x3 x3 x3 x3




3. Write an algorithm that describes a common task, such as baking a cake.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




© 2024 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3
1
website, in whole or in part.
x3 x3 x3 x3 x3

,Solution and Answer Guide For All Chapters: Lambert, Fundamentals of Python: First Programs, 3e, CY24, 9780357881019; Chapter 1, Introduction
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:

There are various ways to do this, but here is one:
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Preheat an oven to 375 degrees x3 x3 x3 x3 x3




Add 1 cup of water and 1 egg to a mixing bowl
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Beat the liquid mixture in the bowl until the ingredients are blended Add
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




the contents of a boxed cake mix to the mixing bowl
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Beat the mixture in the bowl until the ingredients are blended
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Pour the contents of the mixing bowl into a lightly greased cake pan
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Bake the cake in the oven for 45 minutes
x3 x3 x3 x3 x3 x3 x3 x3 x3




4. Describe an instruction that is not well defined and thus could not be included as a step in an algorithm.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Give an example of such an instruction.
x3 x3 x3 x3 x3 x3 x3




Solution:

Attempting to divide a number by 0 x3 x3 x3 x3 x3 x3




5. In what sense is a laptop computer a general-purpose problem-solving machine?
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:

A laptop computer is a general-purpose problem-solving machine because it is programmable and can solve
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




any problem for which there is an algorithm.
x3 x3 x3 x3 x3 x3 x3 x3




6. List four devices that use computers and describe the information that they process. (Hint: Think of the
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




inputs and outputs of the devices.)
x3 x3 x3 x3 x3 x3




Solution:
Digital camera—images, music player—sound, cell phone—text, ATM—numbers
x3 x3 x3 x3 x3 x3




EXERCISE 1.2 X3




1. List two examples of input devices and two examples of output devices.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:
Input devices—keyboard and mouse, output devices—monitor and speakers
x3 x3 x3 x3 x3 x3 x3




2. What does the central processing unit (CPU) do?
x3 x3 x3 x3 x3 x3 x3




Solution:
The CPU fetches, decodes, and executes instructions.
x3 x3 x3 x3 x3 x3




3. How is information represented in hardware memory?
x3 x3 x3 x3 x3 x3




Solution:
Information is represented using binary notation, which in hardware is a pattern of voltage levels.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




© 2024 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3
2
website, in whole or in part.
x3 x3 x3 x3 x3

,Solution and Answer Guide For All Chapters: Lambert, Fundamentals of Python: First Programs, 3e, CY24, 9780357881019; Chapter 1, Introduction
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




4. What is the difference between a terminal-based interface and a graphical user interface?
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:
A terminal-based interface supports only the input and output of text with a keyboard and monitor. A
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




graphical user interface supports the output of images and the manipulation of them with a pointing device,
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




the mouse.
x3 x3




5. What role do translators play in the programming process?
x3 x3 x3 x3 x3 x3 x3 x3




Solution:
A translator converts a program written in a high-level language (human readable and writable) to an
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




equivalent program in a low-level language (machine readable and executable).
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




EXERCISE 1.3 X3




1. Describe what happens when the programmer enters the string "Greetings!" in the Python shell.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:

Python reads the string "Greetings!", evaluates it, and displays this string (including single quotes) in
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




the shell.
x3 x3




2. Write a line of code that prompts the user for their name and saves the user’s input in a variable called
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




name.

Solution:
name= input("Enter your name: ")
3
x x3 x3 x3 x3




3. What is a Python script?
x3 x3 x3 x3




Solution:

A Python script is a complete Python program that can be run from a computer’s operating system.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




4. Explain what goes on behind the scenes when your computer runs a Python program.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




Solution:

If the program has not already been translated, Python’s compiler translates it to byte code. The Python
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




virtual machine then executes this code.
x3 x3 x3 x3 x3 x3




© 2024 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3
3
website, in whole or in part.
x3 x3 x3 x3 x3

, Solution and Answer Guide For All Chapters: Lambert, Fundamentals of Python: First Programs, 3e, CY24, 9780357881019; Chapter 1, Introduction
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




REVIEW QUESTIONS ANSWERS X3 X3




1. Which of the following is an example of an algorithm?
x3 x3 x3 x3 x3 x 3 x3 x3 x3




a. A dictionary
x3




b. A recipe
x3




c. A shopping list
x3 x3




d. The spelling checker of a word processor
x3 x3 x3 x3 x3 x3




Answer: b x3




Feedback:

a. Incorrect. A dictionary is a data structure. x3 x3 x3 x3 x3 x3




b. Correct. A recipe is a set of instructions that describes a process that halts with a solution to a problem.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




c. Incorrect. A shopping list is a data structure. x3 x3 x3 x3 x3 x3 x3




d. Incorrect. A word processor is a program that consists of instructions and data.
x 3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




2. Which of the following contains information?
x3 x3 x3 x3 x3




a. An audio CD x3 x3




b. A refrigerator
x3




c. An automobile x3




d. A stereo speaker
x3 x3




x3Answer: a x3




x3Feedback:

a. Correct. The information on an audio CD represents sound.
x3 x3 x3 x3 x3 x3 x3 x3




b. Incorrect. A refrigerator contains just food, if it’s not empty.x3 x3 x3 x3 x3 x3 x3 x3 x3




c. Incorrect. An automobile contains a steering wheel, engine, exhaust pipe, and so on.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




d. Incorrect. A stereo speaker contains a magnetic coil, wires, and so on.
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3




3. Which of the following is a general-purpose computing device?
x3 x3 x3 x3 x3 x3 x3 x3




a. A smartphone
x3




b. A portable music player
x3 x3 x3




c. A microwave oven
x3 x3




d. A programmable thermostat
x3 x3




© 2024 Cengage. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible
x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3 x3
4
website, in whole or in part.
x3 x3 x3 x3 x3

Libro relacionado
 image
Editorial: 2023 ISBN: 9780357881019 Edición: Desconocido

Información del documento

Subido en
27 de abril de 2026
Número de páginas
167
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$26.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Lectpotter
4.8
(186)
Vendido
132
Seguidores
8
Artículos
2599
Última venta
6 días hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes