python - Data_Types - Part I

KSATs: K0008, K0014, K0015, K0016, K0017, K0018, K0019, K0111, K0711, K0712, K0716, S0023, S0024, S0029, S0030

Measurement: Written, Performance

Lecture Time: 30 Minutes

Demo/Performance Time:

Instructional Methods: Informal Lecture & Demonstration/Performance

Multiple Instructor Requirements: 1:8 for Labs

Classification: UNCLASSIFIED

Lesson Objectives:

  • LO 1 Describe tuples (Proficiency Level: B)

    • MSB 1.1 Describe the purpose of tuples (Proficiency Level: B)
    • MSB 1.2 Describe the properties of tuples (Proficiency Level: B)
  • LO 2 Discuss the use of the range() function in Python3

  • LO 3 Describe a string (Proficiency Level: B)

    • MSB 3.1 Distinguish between the default string encoding in Python2 vs Python3 (Proficiency Level: B)
    • MSB 3.2 Describe the options for string variable assignment (Proficiency Level: B)
    • MSB 3.3 Identify string prefixes (Proficiency Level: B)
  • LO 4 Describe basic string methods (Proficiency Level: B)

  • LO 5 Comprehend dictionaries in Python (Proficiency Level: C)

    • MSB 5.1 Describe the syntax to create a dictionary (Proficiency Level: B)
    • MSB 5.2 Describe the syntax to access items in a dictionary (Proficiency Level: B)
    • MSB 5.3 Describe the syntax to add, update and delete items in a dictionary (Proficiency Level: B)
    • MSB 5.4 Describe the syntax to create and access multi-dimensional dictionaries (Proficiency Level: B)
  • LO 6 Comprehend sets Python (Proficiency Level: A)

    • MSB 6.1 Describe the syntax to create a set (Proficiency Level: B)
    • MSB 6.2 Describe the syntax to access items in a set (Proficiency Level: B)
    • MSB 6.3 Describe the syntax to add and delete items in a set (Proficiency Level: B)
  • LO 7 Comprehend frozensets in Python (Proficiency Level: A)

  • LO 8 Differentiate operations that can be done to a set but not a frozenset in Python (Proficiency Level: A)

  • LO 9 Employ variables in Python (Proficiency Level: C)

    • MSB 9.1 Describe the purpose of variables (Proficiency Level: B)
    • MSB 9.2 Describe the syntax to determine data type of a variable (Proficiency Level: B)
    • MSB 9.3 Describe the syntax to assign a variable (Proficiency Level: B)
  • LO 10 Apply the concept of mutability (Proficiency Level: B)

    • MSB 10.1 Describe mutability (Proficiency Level: B)
    • MSB 10.2 Identify the mutability of specific data types in Python (Proficiency Level: B)
  • LO 11 Distinguish between different number prefixes (Proficiency Level: B)

  • LO 12 Distinguish between different number types (Proficiency Level: B)

  • LO 13 Describe the Boolean data type (Proficiency Level: B)

  • LO 14 Employ arithmetic operators (Proficiency Level: C)

    • MSB 14.1 Differentiate arithmetic operators (Proficiency Level: C)
    • MSB 14.2 Given a scenario predict the resulting type of a math operation with different operand types (Proficiency Level: C)
    • MSB 14.3 Differentiate bitwise operators (Proficiency Level: B)
    • MSB 14.4 Describe the order of operations (Proficiency Level: B)
  • LO 15 Employ type conversion (Proficiency Level: C)

  • LO 16 Comprehend lists in Python (Proficiency Level: B)

    • MSB 16.1 Describe the syntax to slice a list (Proficiency Level: B)
    • MSB 16.2 Describe the syntax to retrieve/modify/delete an element of a list (Proficiency Level: B)
    • MSB 16.3 Describe the syntax to combine a list (Proficiency Level: B)
    • MSB 16.4 Comprehend multidimensional lists (Proficiency Level: B)
  • LO 17 Comprehend map, filter and reduce in Python (Proficiency Level: B)

Performance Objectives (Proficiency Level: 3c)

  • Conditions: Given access to (references, tools, etc.):

    • Access to specified remote virtual environment
    • Student Guide and Lab Guide
    • Student Notes
  • Performance/Behavior Tasks:

    • Store specified data in a tuple.
    • Create a program using strings and string methods
    • Utilize string methods to manipulate strings
    • Store user input as a string
    • Use the Python interpreter to identify the data type
    • Use arithmetic operators to modify Python program functionality
    • Use bitwise operators to modify Python program functionality
    • Use type conversion to modify Python program functionality
    • Use Python to create, access and manipulate a list
    • Use Python to create, access and manipulate a Multi-dimensional list
  • Standard(s)

    • Criteria: Demonstration: Correctable to 100% in class
    • Evaluation: Students will have 4 hours to complete the timed evaluation consisting of both cognitive and performance components.
    • Minimum passing score is 80%

References

  1. https://docs.python.org/3/library/numbers.html
  2. https://docs.python.org/3/library/stdtypes.html
  3. https://docs.python.org/3/library/string.html
  4. https://docs.python.org/3/tutorial/datastructures.html
  5. https://realpython.com/python-dicts/
  6. https://www.tutorialspoint.com/python/python_variable_types.htm
  7. https://www.tutorialspoint.com/python3/python_strings.htm
  8. https://www.w3schools.com/python/python_dictionaries.asp
  9. https://www.w3schools.com/python/python_lists.asp
  10. https://www.w3schools.com/python/python_tuples.asp