Data Types Conceptual Questions


Questions

Conceptual

  1. str literals in Python can be surrounded in either single-quote characters ('like this') or double-quote characters ("like this"), though in COMP110 we prefer the double-quotes. (T/F)
  2. TRUE and FALSE are valid bool values in Python. (T/F)
  3. An int literal can begin with a zero, but cannot end with a zero. (T/F)
  4. What function can we use to identify the type classification of any object in Python?
  5. What is a bool data type in Python?
    1. Data type for storing text
    2. Data type for storing whole numbers such as -10, 3, or 100
    3. Data type for storing True/False values
    4. Data type for storing any type of information
    5. Data type for storing numbers with a decimal point such as 1.0, 3.14, or -0.1
  6. What is an int data type in Python?
    1. Data type for storing text
    2. Data type for storing whole numbers such as -10, 3, or 100
    3. Data type for storing True/False values
    4. Data type for storing any type of information
    5. Data type for storing numbers with a decimal point such as 1.0, 3.14, or -0.1
  7. What is a str data type in Python?
    1. Data type for storing text
    2. Data type for storing whole numbers such as -10, 3, or 100
    3. Data type for storing True/False values
    4. Data type for storing any type of information
    5. Data type for storing numbers with a decimal point such as 1.0, 3.14, or -0.1
  8. An int literal can begin with any number of zeroes. (T/F)
  9. Which of the following literals are a float?
    1. 4
    2. "4"
    3. 4.0
    4. "4.0"
  10. What function can you use to determine the type of an object in Python?
    1. print()
    2. str()
    3. len()
    4. type()

Solutions

Solutions

Conceptual Solutions

  1. True
  2. False
  3. False
  4. type()
  5. C
  6. B
  7. A
  8. False
  9. C
  10. D
Contributor(s): Alyssa Lytle, Megan Zhang, David Karash, Benjamin Eldridge