Filters
Question type

Study Flashcards

The + operator allows you to build a string by repeating another string a given number of times.

A) True
B) False

Correct Answer

verifed

verified

string is an example of a data type in Python.

A) True
B) False

Correct Answer

verifed

verified

In Python, what data type is used to represent real numbers between -10^308 and 10^308 with 16 digits of precision?


A) int
B) float
C) string
D) array

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

What will be the return value of running the following function? chr(ord('T') + 5) ?


A) 78
B) \t
C) 0x89
D) "Y"

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

When attempting to produce a correct program, what is the point of developing a test suite?


A) To provide a small set of inputs as a test to verify that a program will be correct for all inputs.
B) To modify the running program's variables and verify that the program will still function, even if the code changes.
C) To test the outputs of a program against known values to verify that the math coprocessor is performing properly.
D) To test the code syntax for possible errors such as undefined variables.

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

1,500 is a valid integer literal in Python.

A) True
B) False

Correct Answer

verifed

verified

You are working on a Python script that relies heavily on the cos and sin functions of the math module. As these are the only functions you require, what should you do to import only these functions, rather than the whole math module?


A) import cos, sin
B) import cos, sin from math
C) import math.cos, math.sin
D) from math import cos, sin

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

D

What function can you call inside of IDLE to show the resources of the math module, once it has been imported?


A) show(math)
B) list(math)
C) dir(math)
D) resource(math)

E) All of the above
F) C) and D)

Correct Answer

verifed

verified

Testing is a deliberate process that requires some planning and discipline on the programmer's part.

A) True
B) False

Correct Answer

verifed

verified

Which of the following functions and expressions will convert the ASCII character "Z" to its numeric equivalent ASCII code?


A) ord('Z')
B) chr('Z')
C) ord(chr('Z') )
D) chr(ord('Z') )

E) A) and C)
F) None of the above

Correct Answer

verifed

verified

You can use parentheses to change the order of evaluation in an arithmetic expression.

A) True
B) False

Correct Answer

verifed

verified

How does the int function convert a float to an int?


A) By rounding to the nearest whole number.
B) By removing the fractional value of the number.
C) By rounding up to the closest whole number.
D) By rounding down to the closest whole number.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

What statement accurately reflects the difference between the quotient operator and the division operator?


A) The two operators are effectively the same, unless being carried out on strings.
B) The quotient operator produces a float, while the division operator produces an integer.
C) The quotient operator produces a float, while the division operator produces an integer + remainder.
D) The quotient operator produces an integer, while the division operator produces a float.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

D

What is the largest value of an int data type in the Python programming language?


A) 2,147,483,647
B) 4,294,967,294
C) 2,147,483,647^100
D) The value is limited only by the memory of the host computer.

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Text processing is by far the least common application of computing.

A) True
B) False

Correct Answer

verifed

verified

In Python, a floating-point number must be written using scientific notation.

A) True
B) False

Correct Answer

verifed

verified

What term describes the process of substituting a simple process for a complex process in a program to make the program easier to understand and maintain?


A) refactoring
B) abstraction
C) inferring
D) subletting

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

What must be done in order to concatenate a string and a float object?


A) Nothing can be done, as the two data types cannot be converted to a compatible type.
B) The string object must be converted to a float object via the float() function.
C) The float object must be converted to an integer object via the int() function.
D) The float object must be converted to a string object via the str() function.

E) A) and D)
F) C) and D)

Correct Answer

verifed

verified

In the maintenance phase of the waterfall model, the parts of a program are brought together into a smoothly functioning whole, usually not an easy task.

A) True
B) False

Correct Answer

verifed

verified

False

You are reviewing the code written by another programmer, and encounter a variable whose name is entirely in capital letters. What might you discern from this variable name?


A) The variable is a symbolic constant.
B) The variable is a reference variable.
C) The variable is part of a program loop.
D) The variable is used to store a dynamic value that is constantly changing.

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer