COSC Final Exam Questions and
Answers16
Data types must be specified for function parameters in Python. - ANSWERS-false
Function parameters specify a template for data that a function can accept. - ANSWERS-true
A function parameter is data that is passed to a function, whereas a function argument is listed
as a variable inside the parentheses at the end of the function name. - ANSWERS-false
A(n) ____ variable is accessible to an entire program whereas a(n) ____ variable is limited to a
specific part of a program. - ANSWERS-global, local
What statement describes the purpose of function parameters in a function declaration? -
ANSWERS-Function parameters specify a template for data that a function can accept.
A function call can pass a variable, as well as a literal, to a function parameter. - ANSWERS-true
A function can have multiple parameters. - ANSWERS-true
The popular programming languages Python and ________ are the two most widely used data-
science languages. - ANSWERS-R
Which logical unit of the computer is the receiving section? - ANSWERS-input unit
,Python recently surpassed the programming language ________ as the most popular data-
science programming language. - ANSWERS-R
T/F : Translator programs called assemblers convert high-level-language source code into
machine language. - ANSWERS-False
T/F : Computing costs are rising dramatically, due to the increasing complexity of hardware and
software technologies. - ANSWERS-False
A(n) ________ is the smallest data item in a computer. It can have the value 0 or 1. - ANSWERS-
bit
In which IPython interpreter mode do you enter small bits of Python code called snippets and
immediately see their results? - ANSWERS-interactive mode
T/F : a gigabyte is 1024 megabytes. - ANSWERS-true
T/F: Interpreter programs, developed to execute high-level language programs directly, avoid
the delay of compilation, and run faster than compiled programs. - ANSWERS-false
In the following expression, the addition operators (+) group as if we parenthesized the
expression as a+(b+c). - ANSWERS-false
Python ignores all white space. - ANSWERS-
If an expression contains several exponentiation operations, Python applies them from left to
right. - ANSWERS-false
, What does the int function attempt to do in the following code? - ANSWERS-Convert a string to
an integer
Which of the following statements about arithmetic operators is false? - ANSWERS-Expressions
containing an integer and a floating-point number are mixed-type expressions-these always
produce an integer.
Placing two backslashes back-to-back tells print to display a blank line. - ANSWERS-false
Each suite contains zero or more statements. - ANSWERS-false
Using the assignment symbol (=) instead of the equality operator (==) in an if statement's
condition is a common logic error. - ANSWERS-false
The value of the following expression is 3:
17 % 5 - ANSWERS-false
To square a number, you can use the exponent 1/2 (that is, 0.5), as in:
9 ** () - ANSWERS-false
The value of the expression '7' + '3' is the ________. - ANSWERS-string '73'
The expression -13 // 4 evaluates to -3. - ANSWERS-false
Answers16
Data types must be specified for function parameters in Python. - ANSWERS-false
Function parameters specify a template for data that a function can accept. - ANSWERS-true
A function parameter is data that is passed to a function, whereas a function argument is listed
as a variable inside the parentheses at the end of the function name. - ANSWERS-false
A(n) ____ variable is accessible to an entire program whereas a(n) ____ variable is limited to a
specific part of a program. - ANSWERS-global, local
What statement describes the purpose of function parameters in a function declaration? -
ANSWERS-Function parameters specify a template for data that a function can accept.
A function call can pass a variable, as well as a literal, to a function parameter. - ANSWERS-true
A function can have multiple parameters. - ANSWERS-true
The popular programming languages Python and ________ are the two most widely used data-
science languages. - ANSWERS-R
Which logical unit of the computer is the receiving section? - ANSWERS-input unit
,Python recently surpassed the programming language ________ as the most popular data-
science programming language. - ANSWERS-R
T/F : Translator programs called assemblers convert high-level-language source code into
machine language. - ANSWERS-False
T/F : Computing costs are rising dramatically, due to the increasing complexity of hardware and
software technologies. - ANSWERS-False
A(n) ________ is the smallest data item in a computer. It can have the value 0 or 1. - ANSWERS-
bit
In which IPython interpreter mode do you enter small bits of Python code called snippets and
immediately see their results? - ANSWERS-interactive mode
T/F : a gigabyte is 1024 megabytes. - ANSWERS-true
T/F: Interpreter programs, developed to execute high-level language programs directly, avoid
the delay of compilation, and run faster than compiled programs. - ANSWERS-false
In the following expression, the addition operators (+) group as if we parenthesized the
expression as a+(b+c). - ANSWERS-false
Python ignores all white space. - ANSWERS-
If an expression contains several exponentiation operations, Python applies them from left to
right. - ANSWERS-false
, What does the int function attempt to do in the following code? - ANSWERS-Convert a string to
an integer
Which of the following statements about arithmetic operators is false? - ANSWERS-Expressions
containing an integer and a floating-point number are mixed-type expressions-these always
produce an integer.
Placing two backslashes back-to-back tells print to display a blank line. - ANSWERS-false
Each suite contains zero or more statements. - ANSWERS-false
Using the assignment symbol (=) instead of the equality operator (==) in an if statement's
condition is a common logic error. - ANSWERS-false
The value of the following expression is 3:
17 % 5 - ANSWERS-false
To square a number, you can use the exponent 1/2 (that is, 0.5), as in:
9 ** () - ANSWERS-false
The value of the expression '7' + '3' is the ________. - ANSWERS-string '73'
The expression -13 // 4 evaluates to -3. - ANSWERS-false