o Use one of the augmented assignment operators, such as: +=, -=, *=, and /=
• Input and Output methods and techniques. Write Python statements that:
o Produce Console Output. Write Python statements that:
▪ Call print() to write output statements to the console.
▪ Call print() with multiple arguments.
o Console Input. Write Python statements that:
▪ Call input() to read input data from the console. Include output of all primitive types (int,
float, and str), and call proper conversion functions as needed.
▪ Validate input of data from the keyboard.
• Strings
o Write Python statements that utilize the str data type
o Call the following methods on a str: upper(), lower()
o Call the len() function on a str and other data types
• The Python Shell, Python programs, and an Integrated Development Environment (IDE)
o Be able to write, check syntax, and run Python programs
o Be able to write Python programs combining the statements described in this document
• If Statements. Write Python statements that:
o Use one or more relational operators >, <, >=, <=, ==, !=
o Use one or more Boolean operators: and, or, not
o Use an if/elif/else statement (multi-level, many branches)
• Loops. Write Python statements that:
o Contain a while loop
o Contain a for loop that uses the range function
o Contain a for loop that iterates over an iterable object
• Functions.
o Write statements that call functions and pass arguments.
o Write various functions in one program.
o Write functions that accept parameters.
o Write return statements.
o Create local variables.
o Optional: Discuss difference when passing mutable vs. immutable objects
• Lists. Write Python statements that:
o Create, append, and index from a list.
o Optional: Pass a list to a function or method. Show effect of mutable list.
• Tuples.
o Be able to differentiate between lists and tuples and explain the differences and uses of each
• Dictionaries
o Write Python statements that:
▪ Create, add, retrieve from a dictionary
o Distinguish between various data types of keys and values
• Functions, Methods, and Modules
o Define the relationship between a class (type) and method.
o Differentiate between functions, methods, and modules.
o Write Python statements that call built-in functions
o Write Python statements that call methods and understand the concept of the object
• Import and use modules from the Python Standard Library
o Required: math module, random module
o Optional: sys, json, sqlite3, csv, other PSL modules or third-party modules.
• Exceptions
o Describe the concept of inheritance such that the exception inheritance hierarchy can be understood.
o Write a try / except block to catch an exception
o Use various exception types, such as TypeError, IndexError, and exceptions that are raised with File
I/O
• Other Python language features
o Optional: Use of the pass statement
o Optional: Call the type() method to determine the type
• File I/O. Write Python statements that:
o Open a text file for reading. Read data from a text file. Close the text file.