D335: INTRODUCTION TO PYTHON (SECTIONS 1-4) EXAM WITH
ALL ANSWERS
1.Input: GA Gprogram Ggets Gdata, Gperhaps Gfrom Ga Gfile, Gkeyboard,
Gtouchscreen, Gnetwork, Getc.
2.Process: GA Gprogram Gperforms Gcomputations Gon Gthat Gdata, Gsuch
Gas Gadding Gtwo Gvalues Glike Gx G+ Gy
3.Output: GA Gprogram Gputs Gthat Gdata Gsomewhere, Gsuch Gas Gto Ga
Gfile, Gscreen, Gor Gnetwork.
4.computational Gthinking,: Gcreating Ga Gsequence Gof Ginstructions Gto Gsolve
Ga Gproblem
5.algorithm: GA Gsequence Gof Ginstructions Gthat Gsolves Ga Gproblem
6.Python Ginterpreter: Ga Gcomputer Gprogram Gthat Gexecutes Gcode Gwritten
Gin Gthe GPython Gprogramming Glanguage.
7.interactive Ginterpreter: Ga Gprogram Gthat Gallows Gthe Guser Gto Gexecute
Gone Gline Gof Gcode Gat Ga Gtime
8.Code: Ga Gcommon Gword Gfor Gthe Gtextual Grepresentation Gof Ga Gprogram
9.line: Grow Gof Gtext
10.prompt: Gindicates Gthe Ginterpreter Gis Gready Gto Gaccept Gcode
11.statement: Ga Gprogram Ginstruction
12.Expressions: Gcode Gthat Greturn Ga Gvalue Gwhen Gevaluated
13.cariables: Gnamed Greferences Gto Gvalues Gstored Gby Gthe Ginterpreter
14.print(): Gfunction Gthat Gdisplays Gvariables Gor Gexpression Gvalues
15.'#": Gcharacter Gtha Gdenote Gcomments, Gwhich Gare Goptional Gbut
1 G/
G13
, Gcan Gbe Gused Gto Gexplains Gportions Gof Gcode Gto Ga Ghuman Greader
16.string Gliteral: Gtext Genclosed Gin Gquotes G(single Gor Gdouble) Gand Gcan
Gcontain Gletters, Gnumbers, Gspaces, Gor Gsymbols
17.Why Gwould Ga Gprogrammer Gadd
end=' G' Ginside Gof Gprint()?: GTo Gkeep Gthe Goutput Gon Gthe Gsame Gline
18.print(variable_name) G*without Gquotes*: Gto Goutput Gthe Gvalue Gof Ga
Gvariable
19.\n: Gnewline Gcharacter; Goutput Gcan Gbe Gmoved Gto Gthe Gnext Gline
20.whitespace: Gany Gspace, Gtab, Gor Gnewline
21.variable G= Ginput(): Greads Ga Guser-enter Gstring Gand Gchanges Git Ginto Ga
Gvariable
22.type: Gdetermines Ghow Ga Gvalue Gcan Gbehave
23.int(): Gconverts Ga Gstring Gto Gan Ginteger
24.syntax Gerror: Gviolating Ga Gprogramming Glanguage's Grules Gon Ghow
Gsymbols Gcan Gbe Gcombined Gto Gcreate Ga Gprogram
25.runtime Gerror: Gprogram's Gsyntax Gis Gcorrect, Gbut Gthe Gprogram
Gattemps Gan Gimpos- Gsible Goperation, Gsuch Gas Gdividing Gby Gzero Gor
Gmultiplying Gstrings Gtogether
26.crash: GAbrupt Gand Gunintended Gtermination Gof Ga Gprogram
27.SyntaxError: GThe Gprogram Gcontains Ginvalid Gcode Gthat Gcannot Gbe
Gunderstood.
28.IndentationError: GThe Glines Gof Gthe Gprogram Gare Gnot Gproperly
Gindented.
29.ValueError: GAn Ginvalid Gvalue Gis Gused- Gcan Goccur Gif Ggiving Gletter Gto
Gint().
2 G/
G13
ALL ANSWERS
1.Input: GA Gprogram Ggets Gdata, Gperhaps Gfrom Ga Gfile, Gkeyboard,
Gtouchscreen, Gnetwork, Getc.
2.Process: GA Gprogram Gperforms Gcomputations Gon Gthat Gdata, Gsuch
Gas Gadding Gtwo Gvalues Glike Gx G+ Gy
3.Output: GA Gprogram Gputs Gthat Gdata Gsomewhere, Gsuch Gas Gto Ga
Gfile, Gscreen, Gor Gnetwork.
4.computational Gthinking,: Gcreating Ga Gsequence Gof Ginstructions Gto Gsolve
Ga Gproblem
5.algorithm: GA Gsequence Gof Ginstructions Gthat Gsolves Ga Gproblem
6.Python Ginterpreter: Ga Gcomputer Gprogram Gthat Gexecutes Gcode Gwritten
Gin Gthe GPython Gprogramming Glanguage.
7.interactive Ginterpreter: Ga Gprogram Gthat Gallows Gthe Guser Gto Gexecute
Gone Gline Gof Gcode Gat Ga Gtime
8.Code: Ga Gcommon Gword Gfor Gthe Gtextual Grepresentation Gof Ga Gprogram
9.line: Grow Gof Gtext
10.prompt: Gindicates Gthe Ginterpreter Gis Gready Gto Gaccept Gcode
11.statement: Ga Gprogram Ginstruction
12.Expressions: Gcode Gthat Greturn Ga Gvalue Gwhen Gevaluated
13.cariables: Gnamed Greferences Gto Gvalues Gstored Gby Gthe Ginterpreter
14.print(): Gfunction Gthat Gdisplays Gvariables Gor Gexpression Gvalues
15.'#": Gcharacter Gtha Gdenote Gcomments, Gwhich Gare Goptional Gbut
1 G/
G13
, Gcan Gbe Gused Gto Gexplains Gportions Gof Gcode Gto Ga Ghuman Greader
16.string Gliteral: Gtext Genclosed Gin Gquotes G(single Gor Gdouble) Gand Gcan
Gcontain Gletters, Gnumbers, Gspaces, Gor Gsymbols
17.Why Gwould Ga Gprogrammer Gadd
end=' G' Ginside Gof Gprint()?: GTo Gkeep Gthe Goutput Gon Gthe Gsame Gline
18.print(variable_name) G*without Gquotes*: Gto Goutput Gthe Gvalue Gof Ga
Gvariable
19.\n: Gnewline Gcharacter; Goutput Gcan Gbe Gmoved Gto Gthe Gnext Gline
20.whitespace: Gany Gspace, Gtab, Gor Gnewline
21.variable G= Ginput(): Greads Ga Guser-enter Gstring Gand Gchanges Git Ginto Ga
Gvariable
22.type: Gdetermines Ghow Ga Gvalue Gcan Gbehave
23.int(): Gconverts Ga Gstring Gto Gan Ginteger
24.syntax Gerror: Gviolating Ga Gprogramming Glanguage's Grules Gon Ghow
Gsymbols Gcan Gbe Gcombined Gto Gcreate Ga Gprogram
25.runtime Gerror: Gprogram's Gsyntax Gis Gcorrect, Gbut Gthe Gprogram
Gattemps Gan Gimpos- Gsible Goperation, Gsuch Gas Gdividing Gby Gzero Gor
Gmultiplying Gstrings Gtogether
26.crash: GAbrupt Gand Gunintended Gtermination Gof Ga Gprogram
27.SyntaxError: GThe Gprogram Gcontains Ginvalid Gcode Gthat Gcannot Gbe
Gunderstood.
28.IndentationError: GThe Glines Gof Gthe Gprogram Gare Gnot Gproperly
Gindented.
29.ValueError: GAn Ginvalid Gvalue Gis Gused- Gcan Goccur Gif Ggiving Gletter Gto
Gint().
2 G/
G13