TEST BANK for Fundamentals of Python: First Pro
ty ty ty ty ty ty ty
grams 3rd Edition by Kenneth Lambert
ty ty ty ty ty
Solution and Answer Guide For All Chapters 1-
ty ty ty ty ty ty ty
13| A+ PASS GUARANTEED
ty ty ty
Pagety|ty1
, CHAPTERty1,t y INTRODUCTIONtyTA
BLEtyOFtyCONTENTS
ExercisetySolutions 1
Exercisety1.1 1
Exercisety1.2 2
Exercisety1.3 3
ReviewtyQuestionstyAnswers 4
ProgrammingtyExercisestySolutions 8
DebuggingtyExercisestySolutionst y 8
EXERCISEtySOLUTIONStyEXERCI
SEty1.1
1. Listtythreetycommontytypestyoftycomputingtyagents.
Solution:
Humantybeings,tydesktoptycomputers,tycelltyphones
2. Writetyantyalgorithmtythattydescribestythetysecondtyparttyoftythetyprocesstyoftymakingtychangety(countin
gtyouttythetycoinstyandtybills).
Solution:
Theretyaretyvarioustywaystytotydotythis,tybuttyheretyistyone:
Repeat
SelecttythetylargesttyunittyoftymoneytythattyistylesstythantyortyequaltytotythetyremainingtychangetySubtracttythistyu
nittyfromtythetyremainingtychange
Untiltythetyremainingtychangetyisty0
Thetycollectiontyoftyunitstyselectedtyrepresenttythetychange
Pagety|ty2
,3. Writetyantyalgorithmtythattydescribestyatycommontytask,tysuchtyastybakingtyatycake.
Solution:
Theretyaretyvarioustywaystytotydotythis,tybuttyheretyistyone:
Preheattyantyoventytoty375tydegrees
Addty1tycuptyoftywatertyandty1tyeggtytotyatymixingtybowl
BeattythetyliquidtymixturetyintythetybowltyuntiltythetyingredientstyaretyblendedtyAddtythetycontentstyoftyatyboxed
tycaketymixtytotythetymixingtybowl
Beattythetymixturetyintythetybowltyuntiltythetyingredientstyaretyblended
PourtythetycontentstyoftythetymixingtybowltyintotyatylightlytygreasedtycaketypantyBaketythetycaketyintythetyoventy
forty45tyminutes
4. Describetyantyinstructiontythattyistynottywelltydefinedtyandtythustycouldtynottybetyincludedtyastyatysteptyintyant
yalgorithm.tyGivetyantyexampletyoftysuchtyantyinstruction.
Solution:
Attemptingtytotydividetyatynumbertybyty0
5. Intywhattysensetyistyatylaptoptycomputertyatygeneral-purposetyproblem-solvingtymachine?
Solution:
Atylaptoptycomputertyistyatygeneral-purposetyproblem-
solvingtymachinetybecausetyittyistyprogrammabletyandtycantysolvetyanytyproblemtyfortywhichtytheretyistyantyalg
orithm.
6. Listtyfourtydevicestythattyusetycomputerstyandtydescribetythetyinformationtythattytheytyprocess.ty(Hint:tyThi
nktyoftythetyinputstyandtyoutputstyoftythetydevices.)
Solution:
Digitaltycamera—images,tymusictyplayer—sound,tycelltyphone—text,tyATM—numbers
Pagety|ty3
, Pagety|ty4
ty ty ty ty ty ty ty
grams 3rd Edition by Kenneth Lambert
ty ty ty ty ty
Solution and Answer Guide For All Chapters 1-
ty ty ty ty ty ty ty
13| A+ PASS GUARANTEED
ty ty ty
Pagety|ty1
, CHAPTERty1,t y INTRODUCTIONtyTA
BLEtyOFtyCONTENTS
ExercisetySolutions 1
Exercisety1.1 1
Exercisety1.2 2
Exercisety1.3 3
ReviewtyQuestionstyAnswers 4
ProgrammingtyExercisestySolutions 8
DebuggingtyExercisestySolutionst y 8
EXERCISEtySOLUTIONStyEXERCI
SEty1.1
1. Listtythreetycommontytypestyoftycomputingtyagents.
Solution:
Humantybeings,tydesktoptycomputers,tycelltyphones
2. Writetyantyalgorithmtythattydescribestythetysecondtyparttyoftythetyprocesstyoftymakingtychangety(countin
gtyouttythetycoinstyandtybills).
Solution:
Theretyaretyvarioustywaystytotydotythis,tybuttyheretyistyone:
Repeat
SelecttythetylargesttyunittyoftymoneytythattyistylesstythantyortyequaltytotythetyremainingtychangetySubtracttythistyu
nittyfromtythetyremainingtychange
Untiltythetyremainingtychangetyisty0
Thetycollectiontyoftyunitstyselectedtyrepresenttythetychange
Pagety|ty2
,3. Writetyantyalgorithmtythattydescribestyatycommontytask,tysuchtyastybakingtyatycake.
Solution:
Theretyaretyvarioustywaystytotydotythis,tybuttyheretyistyone:
Preheattyantyoventytoty375tydegrees
Addty1tycuptyoftywatertyandty1tyeggtytotyatymixingtybowl
BeattythetyliquidtymixturetyintythetybowltyuntiltythetyingredientstyaretyblendedtyAddtythetycontentstyoftyatyboxed
tycaketymixtytotythetymixingtybowl
Beattythetymixturetyintythetybowltyuntiltythetyingredientstyaretyblended
PourtythetycontentstyoftythetymixingtybowltyintotyatylightlytygreasedtycaketypantyBaketythetycaketyintythetyoventy
forty45tyminutes
4. Describetyantyinstructiontythattyistynottywelltydefinedtyandtythustycouldtynottybetyincludedtyastyatysteptyintyant
yalgorithm.tyGivetyantyexampletyoftysuchtyantyinstruction.
Solution:
Attemptingtytotydividetyatynumbertybyty0
5. Intywhattysensetyistyatylaptoptycomputertyatygeneral-purposetyproblem-solvingtymachine?
Solution:
Atylaptoptycomputertyistyatygeneral-purposetyproblem-
solvingtymachinetybecausetyittyistyprogrammabletyandtycantysolvetyanytyproblemtyfortywhichtytheretyistyantyalg
orithm.
6. Listtyfourtydevicestythattyusetycomputerstyandtydescribetythetyinformationtythattytheytyprocess.ty(Hint:tyThi
nktyoftythetyinputstyandtyoutputstyoftythetydevices.)
Solution:
Digitaltycamera—images,tymusictyplayer—sound,tycelltyphone—text,tyATM—numbers
Pagety|ty3
, Pagety|ty4