CS 118 Final Study Guide Exam With
Complete Solutions
1.True or False?
Guido van Rossum is the created of the Python programming language. -
ANSWER True
2.True or False?
IDLE is the integrated development environment (IDE) bundled with the
Python programming language. - ANSWER True
3.True or False?
The Python Standard Library is a collection of example Python programs. -
ANSWER False
4.True or False?
The values of the arithmetic expression 2 * (2 ** 3) in Python is 16. -
ANSWER True
5.True or False?
The following expressions 4(2 + 6) and 4*(2 + 6) are equivalent in Python. -
ANSWER False
6.True or False?
The input function in Python both displays output on the screen and gets
input from the user.Multiple Choice Questions - ANSWER True
7.Python is most commonly translated by use of an
,(a)interpreter
(b)compiler
(c)executer - ANSWER (a) interpreter
8.Characters within quotes, such as 'Hello World!', are
called
(a)buffers
(b)textlines
(c)strings - ANSWER (c) strings
9.For the following lines of Python code, assuming that the user enters
"Charles" when prompted for their name, what would the output be?
name = input('What is your name? ')print('Hello', name)
(a)Hello, Charles
(b)Hello, Charles
(c)Hello, Charles! - ANSWER (b) Hello, Charles
10. True or False?
In Python, a comma can be used in numerical literal values greater than
999. That is, one thousand can be represented as either 1,000 or 1000
within a Python program. - ANSWER False
11. True or False?
In Python, a positive sign may be placed in front of positive numeric
values. - ANSWER True
12. True or False?
Floating-point values have both a limited range and a limited precision. -
ANSWER True
13. True or False?
Since any floating-point representation contains only a finite number of
digits, what is stored for many floating-point values is only an
approximation of the true value. - ANSWER True
14. True or False?
, Arithmetic overflow can result from the division of two floating-point values.
- ANSWER False
15. True or False?
The format function is only for use with numeric values. - ANSWER False
16. True or False?
There is no practical limit to the size of an integer in Python. - ANSWER
True
17. True or False?
You cannot rely on the result of floating-point calculations to be
mathematically precise. - ANSWER True
18. True or False?
In Python, string literals may contain quotes as part of its value. -
ANSWER True
19. True or False?
The character encoding of the character '2' in Python is 00000010. -
ANSWER False
20. True or False?
An escape sequence in Python is a sequence of characters beginning with
'\n'. - ANSWER False
21. True or False?
In Python, an empty string may be represented with a pair of matching
quotes containing only a single space character. - ANSWER False
22. True or False?
Program lines may be joined by use of the backslash character.Multiple
Choice Questions - ANSWER True
23. In Python, the resulting value from a numeric calculation resulting in
arithmetic overflow is
(a)0.0
(b)inf
(c)9999999999999999
Complete Solutions
1.True or False?
Guido van Rossum is the created of the Python programming language. -
ANSWER True
2.True or False?
IDLE is the integrated development environment (IDE) bundled with the
Python programming language. - ANSWER True
3.True or False?
The Python Standard Library is a collection of example Python programs. -
ANSWER False
4.True or False?
The values of the arithmetic expression 2 * (2 ** 3) in Python is 16. -
ANSWER True
5.True or False?
The following expressions 4(2 + 6) and 4*(2 + 6) are equivalent in Python. -
ANSWER False
6.True or False?
The input function in Python both displays output on the screen and gets
input from the user.Multiple Choice Questions - ANSWER True
7.Python is most commonly translated by use of an
,(a)interpreter
(b)compiler
(c)executer - ANSWER (a) interpreter
8.Characters within quotes, such as 'Hello World!', are
called
(a)buffers
(b)textlines
(c)strings - ANSWER (c) strings
9.For the following lines of Python code, assuming that the user enters
"Charles" when prompted for their name, what would the output be?
name = input('What is your name? ')print('Hello', name)
(a)Hello, Charles
(b)Hello, Charles
(c)Hello, Charles! - ANSWER (b) Hello, Charles
10. True or False?
In Python, a comma can be used in numerical literal values greater than
999. That is, one thousand can be represented as either 1,000 or 1000
within a Python program. - ANSWER False
11. True or False?
In Python, a positive sign may be placed in front of positive numeric
values. - ANSWER True
12. True or False?
Floating-point values have both a limited range and a limited precision. -
ANSWER True
13. True or False?
Since any floating-point representation contains only a finite number of
digits, what is stored for many floating-point values is only an
approximation of the true value. - ANSWER True
14. True or False?
, Arithmetic overflow can result from the division of two floating-point values.
- ANSWER False
15. True or False?
The format function is only for use with numeric values. - ANSWER False
16. True or False?
There is no practical limit to the size of an integer in Python. - ANSWER
True
17. True or False?
You cannot rely on the result of floating-point calculations to be
mathematically precise. - ANSWER True
18. True or False?
In Python, string literals may contain quotes as part of its value. -
ANSWER True
19. True or False?
The character encoding of the character '2' in Python is 00000010. -
ANSWER False
20. True or False?
An escape sequence in Python is a sequence of characters beginning with
'\n'. - ANSWER False
21. True or False?
In Python, an empty string may be represented with a pair of matching
quotes containing only a single space character. - ANSWER False
22. True or False?
Program lines may be joined by use of the backslash character.Multiple
Choice Questions - ANSWER True
23. In Python, the resulting value from a numeric calculation resulting in
arithmetic overflow is
(a)0.0
(b)inf
(c)9999999999999999