Code Examples
CSc 231 Python, Spring, 2018
Here are links to the Python code discussed in lecture.
Basic Data Types
Hello, World!
Simple Numeric Computation
Strings I
Strings II
Strings Operations
Input And Conversion
Lists
List Operations
Control Construct Basics
If Statement
While Loop
For Loop I
For Loop II
Comparison and Boolean Ops
Break and Continue
Control Construct Examples
Copy Input to Output I
Copy Input to Output II
Copy Input to Output III
User Lister
Exceptions
Exceptions I
Copy Input to Output IV
Functions
Function Definition I
Function Definition II
Functions, Parameters, and Globals
Polynomial Evaluator
More Data Types
Del Operator
Tuples
Dictionary Objects
Sorted User Lister
Sorting
More I/O
Output Formatting
Reading Files
Modules and Classes
Sorted User Lister II
Polynomial Module
Polynomial Evaluator II
Account Class
Account Class Driver
System Services
Misc. System Facilities
OS Path Facility
Report Logged-On Users By Name
Find GIF files
TkInter I
A Useless Button
A Colorful, Useless Button
An Objective Useless Button
Better Color
TkInter II
Host Name Lookup
Host Name Lookup 2
Calculator
FTP Download Client
Canvas With Events