Wednesday, November 13, 2019

19FL-IT280-01 - Object Oriented Programming Quiz 5

  • Question 1

    4 out of 4 points
    The main function usually expects no arguments and returns no value.
    Correct Answer:
    Correct True
  • Question 2

    4 out of 4 points
    What happens if you attempt to pop a key from a dictionary and the key does not exist, and you specified no default return?
    Correct Answer:
    Correctb. 
  • Question 3

    4 out of 4 points
    A list is a sequence of data values called indexes.
    Correct Answer:
    Correct False
  • Question 4

    4 out of 4 points
    What statement accurately describes the use of a parameter in Python?
    Correct Answer:
    Correcta. 
  • Question 5

    0 out of 4 points
    You are designing a script that may be imported as a module in other scripts. What variable can you use to check whether the script has been imported as a module, or is running as the main script?
    Correct Answer:
    Correctc. 
  • Question 6

    4 out of 4 points
    What operator should you utilize if you wish to test for object identity between two objects?
    Correct Answer:
    Correctd. 
  • Question 7

    4 out of 4 points
    What happens if you use the following statement to sort a list of numbers called numbers? numbers = numbers.sort()
    Correct Answer:
    Correctb. 
  • Question 8

    4 out of 4 points
    When declaring a tuple, you enclose the tuple's elements in what two characters?
    Correct Answer:
    Correctb. 
  • Question 9

    4 out of 4 points
    A Python dictionary is written as a sequence of key/value pairs separated by commas. These pairs are sometimes called indexes.
    Correct Answer:
    Correct False
  • Question 10

    4 out of 4 points
    What statement correctly defines what a median is?
    Correct Answer:
    Correctc. 
  • Question 11

    4 out of 4 points
    In order to create a docstring for a defined function, where should the docstring be?
    Correct Answer:
    Correcta. 
  • Question 12

    4 out of 4 points
    To prevent aliasing, a new object can be created and the contents of the original can be copied to it.
    Correct Answer:
    Correct True
  • Question 13

    4 out of 4 points
    In a Python dictionary, an association is formed between what two components of the dictionary? (Choose two.)
    Correct Answers:
    Correctc. 
    Correctd. 
  • Question 14

    4 out of 4 points
    An Identity function usually tests its argument for the presence or absence of some property.
    Correct Answer:
    Correct False
  • Question 15

    4 out of 4 points
    The index of the first item in a list is 1.
    Correct Answer:
    Correct False
  • Question 16

    4 out of 4 points
    If you use the range method with a single parameter of 50, what will be the range of integers included in the returned list?
    Correct Answer:
    Correctc. 
  • Question 17

    4 out of 4 points
    You add a new key/value pair to a dictionary by using the subscript operator [].
    Correct Answer:
    Correct True
  • Question 18

    0 out of 4 points
    What dictionary method can be utilized to access the entries in a dictionary variable with a name of parts?
    Correct Answer:
    Correctd. 
  • Question 19

    4 out of 4 points
    When a Python script is running as a standalone program, what will the __name__ variable be set to?
    Correct Answer:
    Correcta. 
  • Question 20

    4 out of 4 points
    The == operator returns True if the variables are aliases for the same object. Unfortunately, == returns False if the contents of two different objects are the same.
    Correct Answer:
    Correct False
  • Question 21

    4 out of 4 points
    In computer science, what are two names that are used to describe data structures organized by association? (Choose two.)
    Correct Answers:
    Correctc. 
    Correctd. 
  • Question 22

    4 out of 4 points
    What list method should you use in order to remove and return the element at the end of the list named "books"?
    Correct Answer:
    Correctd. 
  • Question 23

    4 out of 4 points
    Lists of integers can be built using the range function.
    Correct Answer:
    Correct True
  • Question 24

    4 out of 4 points
    Which of the following assigns a dictionary list of keys and values to the variable named persons?
    Correct Answer:
    Correctb. 
  • Question 25

    4 out of 4 points
    What dictionary operation can you use to remove all the keys within the dictionary named contacts?
    Correct Answer:
    Correctc.