Python Skills for CS-1004, Introduction to Programming for Non-Majors

CS 1004 Programming Skills

These skills are fundamental to solving real problems in any programming language. All lectures, homework assignments, quizzes and exams are designed to help you to develop these skills, to assess your knowledge of them, and to the give you the opportunity to demonstrate you have mastered them.

Python Programming Syntax

PS-1.                     Assignment: associate a variable name with a value

PS-2.                     Know that in Python the type of the value determines the type of the variable

PS-3.                     Know how to insert comments into code fragments and modules

PS-4.                     Understand syntax errors

PS-5.                     Understand concept of NameError

PS-6.                     Understand concept of TypeError

PS-7.                     Understand concept of IndentationError

PS-8.                     Understand context in which variables are defined

PS-9.                     Understand how indentation identifies body of statements

PS-10.                 Understand nested indentation

PS-11.                 Understand operator precedence and use of parentheses for clarity

PS-12.                 Know how to make multiple assignments in a single Python statement

Simple Data Types                         

DT-1.                    Know basic data types of int, bool, char, float

DT-2.                    Know basic mathematical operators {-, +, *, /, //, **}

DT-3.                    Know difference between “/” and “//” division operators

DT-4.                    Generate random integer

DT-5.                    Generate random floating point number

Python Functions

PF-1.                     Know how to define a function

PF-2.                     Know how to define a function with parameters

PF-3.                     Know how to use return statement within a function

PF-4.                     Know how (and why) to compose functions f(g(x))

PF-5.                     Know how to document a function (""")

Python Modules

PM-1.                  Understand how to define a function within a module

PM-2.                  Understand how to import a module

PM-3.                  Understand how to define a variable within a module

PM-4.                  Know how to invoke functions defined in another module

PM-5.                  Know about math module

PM-6.                  Know about sys module

PM-7.                  Know about matplotlib module

PM-8.                  Know about numpy module

PM-9.                  Know how to re-import changed module by restarting Python terminal

PM-10.              Know how to detect when you haven’t imported necessary module

Python Execution

PE-1.                     Know how to execute a python program (from within IDLE)

PE-2.                     Know how to execute a python program (from command prompt or windows desktop)

PE-3.                     Know how to interrupt a running python program

PE-4.                     Be able to use debugger to single step through a Python computation

Python Objects and Methods

OB-1.                   Understand the concept of class

OB-2.                   Understand the concept of object

OB-3.                   Know how to make a new object of a class

OB-4.                   Know how to apply a method of a class to a particular object (using the ‘.’ operator)

OB-5.                   Know how (and why) to chain functions f(x).g(y)

OB-6.                   Understand the difference between immutable and mutable objects

Control Structures

CS-1.                     Know if, else, and elif statements

CS-2.                     Know how to nest if statements

CS-3.                     Write definite for loop

CS-4.                     Know how to use range in definite for loop

CS-5.                     Know how to use while as indefinite loop

CS-6.                     Know how to use break statement within loop

CS-7.                     Know how to use continue statement within loop

CS-8.                     Understand nesting of for and while loops

CS-9.                     Understand logical and, or, not operators

CS-10.                 Understand comparative operators {<, <=, >, >=, ==, <>, !=}

Simple String manipulation

SM-1.                  Know how to convert string into integers and floats

SM-2.                  Know how to convert floats and integers into string

SM-3.                  Know how to read string input from keyboard

SM-4.                  Know how to search through a string to find delimited tokens and regions

SM-5.                  Know how to use ord(char) to determine ASCII or Unicode code for a character

SM-6.                  Know how to use chr(int) to generate character from a given ASCII or Unicode code

String, List, and Dictionary methods

SL-1.                      Know basic string and list operations of +, *, [], slicing, and length

SL-2.                      Know how to iterate thru a string or a list

SL-3.                      Know how to delete an element from a string or list

SL-4.                      Know how to insert an element into a string or list

SL-5.                      Know the difference between a tuple and a list

SL-6.                      Know how to access and modify individual elements of a list

SL-7.                      Understand the concept of a dictionary

SL-8.                      Know how to add things to a dictionary and how to retrieve them

Input Output

IO-1.                     Know how to print information to the console window

IO-2.                     Know how to read raw input from console as string

IO-3.                     Know how to write data to a file

IO-4.                     Know how to read in text data containing strings of text

IO-5.                     Know how to read in CSV formatted data

IO-6.                     Understand use of dictionaries in processing CSV data

IO-7.                     Understand why opened files need to be closed

IO-8.                     Know how to append data to a file

IO-9.                     Know how to use eval to convert arbitrary string into python data type

Debugging Skills                             

DG-1.                   Identify an arithmetic defect

DG-2.                   Identify logic defect

DG-3.                   Identify syntax defect

DG-4.                   Demonstrate logical reasoning from observed error back to failure back to code defect

DG-5.                   Demonstrate by-hand execution of small code fragments

Graphical and Plotting Skills      

GR-1.                   Draw simply geometric figures in a window on the display

GR-2.                   Plot numerical data in a graph

GR-3.                   Plot information on a picture, image, or map

 

Updated August 2016