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
z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9




Solution and Answer Guide For All Chapters z9 z9 z9 z9 z9 z9




LAMBERT, FUNDAMENTALS OF PYTHON: FIRST PROGRAMS, 3E, CY24, 9780357881019; CHAPTER 1,
Z9 Z 9 Z 9 Z9 Z 9 Z9 Z9 Z9 Z9 Z 9




INTRODUCTION
Z9




TABLE OF CONTENTS Z9 Z9




Exercise Solutions ...................................................................................................................................... 1
z9




Exercise 1.1 ............................................................................................................................................. 1
z9




Exercise 1.2 ............................................................................................................................................. 2
z9




Exercise 1.3 ............................................................................................................................................. 3
z9




Review Questions Answers........................................................................................................................ 4
z9 z9




Programming Exercises Solutions ............................................................................................................ 8
z9 z9




Debugging Exercises Solutions.................................................................................................................. 8
z9 z9




EXERCISE SOLUTIONS Z9




EXERCISE 1.1 Z9




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




Solution:

Human beings, desktop computers, cell phones z9 z9 z9 z9 z9




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




and bills).
z9 z9




Solution:

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




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




Subtract this unit from the remaining change
z9 z9 z9 z9 z9 z9 z9




Until the remaining change is 0 z9 z9 z9 z9 z9




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




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




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

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




Solution:

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




Preheat an oven to 375 degrees z9 z9 z9 z9 z9




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




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




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




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




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




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




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




Give an example of such an instruction.
z9 z9 z9 z9 z9 z9 z9




Solution:

Attempting to divide a number by 0 z9 z9 z9 z9 z9 z9




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




Solution:

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




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




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




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




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




EXERCISE 1.2 Z9




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




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




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




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




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




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




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

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




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




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




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




the mouse.
z9 z9




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




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




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




EXERCISE 1.3 Z9




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




Solution:

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




the shell.
z9 z9




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




name.

Solution:
name= input("Enter your name: ")
9
z z9 z9 z9 z9




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




Solution:

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




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




Solution:

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




virtual machine then executes this code.
z9 z9 z9 z9 z9 z9




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

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




REVIEW QUESTIONS ANSWERS Z9 Z9




1. Which of the following is an example of an algorithm?
z9 z9 z9 z9 z9 z 9 z9 z9 z9




a. A dictionary
z9




b. A recipe
z9




c. A shopping list
z9 z9




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




Answer: b z9




Feedback:

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




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




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




d. Incorrect. A word processor is a program that consists of instructions and data.
z 9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9 z9




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




a. An audio CD z9 z9




b. A refrigerator
z9




c. An automobile z9




d. A stereo speaker
z9 z9




z9Answer: a z9




z9Feedback:

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




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




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




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




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




a. A smartphone
z9




b. A portable music player
z9 z9 z9




c. A microwave oven
z9 z9




d. A programmable thermostat
z9 z9




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

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
$22.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.
TestBankPrep
4.9
(298)
Vendido
61
Seguidores
7
Artículos
1224
Última venta
1 semana 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