Exam 6: Objects and Their Use

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Build in function _______ can be used in Python to determine if two variables reference the same object in memory.

(Short Answer)
4.9/5
(30)

For variable n with the value 10,

(Multiple Choice)
4.9/5
(37)

Match the following: -memory location

(Multiple Choice)
4.9/5
(28)

When a turtle is moved to a new position using the setposition method, a line is drawn from its current location to the new location if the turtle is set to be shown (by use of the showturtle method.)

(True/False)
4.8/5
(36)

Suppose that list1 is assigned to a list of tuples. Given the proper code so that a complete copy of list1 is assigned to variable list2.

(Short Answer)
4.8/5
(30)

In Python, an object has certain attributes and behaviors, implemented as

(Multiple Choice)
4.9/5
(30)

Which of the following returns the reference to the "default" turtle created as a result of a call to the setup method?

(Multiple Choice)
4.9/5
(33)

After the following series of assignments are performed, List1 = [1, 2, 3, 4] List2 = list1 List1 = [5, 6, 7, 8]

(Multiple Choice)
4.9/5
(27)

Give Python code to create a square of size 100 x 100 such that its bottom left corner is positioned at screen location (0, 0). Use relative positioning to do this. (Assume that the turtle screen has been set up, and that there is a turtle named the_turtle to make use of.)

(Essay)
4.9/5
(32)

Garbage collection it a process that automatically determines what parts of memory can be deallocated during the execution of a program.

(True/False)
4.7/5
(42)

Python provides a list contructor that can be used to create a deep copy of a list.

(True/False)
4.8/5
(38)

An object contains a set of __________________ and a set of ____________.

(Short Answer)
4.9/5
(32)

The instruction to set the position of a turtle object to the center of the screen is __________________.

(Short Answer)
4.8/5
(46)

After the following series of assignments are performed, List1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] List2 = list(list1) List2[0][0] = 10

(Multiple Choice)
4.8/5
(45)

When one variable is assigned to another, it is the dereferenced value that is assigned, not the reference value.

(True/False)
4.8/5
(41)

For a turtle screen size of 600 x 800, the coordinates of the top left corner are (-300, 400).

(True/False)
4.8/5
(41)

Two objects of the same type store the same set of values, but are represented by instance variables with different identifiers (names) in each.

(True/False)
4.9/5
(43)

The _____________ is used to access a member of an object.

(Short Answer)
4.8/5
(36)

Suppose that list1 and list2 each reference the same list object in memory. Give a set of instruction that would cause the original list reference to be automatically garbage collected.

(Short Answer)
4.8/5
(28)

Match the following: -attribute

(Multiple Choice)
4.8/5
(32)
Showing 21 - 40 of 54
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)