PROGRAM CORE
Credit Hour: 3
Synopsis
This course introduces the students to the foundation of programming using Python. It is about the programming basics (what it is and how it works), problem-solving methods and algorithm development. It includes procedural and data abstractions, program design, debugging, testing, and documentation. Also, it covers input, processing, output, data types, control structures, functions, parameter passing, library functions, files, and exceptions, lists and tuples, and graphical user interfaces programming. At the end of this course, the students will understand the concepts of problem-solving methods and the algorithm development by using Python. The knowledge from this course will be a foundation to any problem-solving methods and algorithm development.
Course Outcomes
Ability to explain and apply the basic concepts of computer systems and programming (operations, data types, control structures, functions, parameter passing, library functions, lists and tuples).
Ability to evaluate technology problems and prepare the solution to the problem using structural programming or graphical user interfaces programming.
Ability to develop an application and improve its robustness based on the problem solution design using Python.
Course Content
Topic:
INTRODUCTION TO COMPUTERS AND PROGRAMMING
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
INPUT, PROCESSING, AND OUTPUT
Designing a Program
Input, Processing, Output
Displaying Output with the print Function
Comments
Variables
Reading Input from the Keyboard
Performing Calculations
More about Data Output
SIMPLE FUNCTIONS
Introduction to Functions
Defining and Calling a Function
Designing a Program to Use Functions
Local Variables
Passing Arguments to Functions
Global Variables and Global Constants
DECISION STRUCTURES AND BOOLEAN LOGIC
The if Statement
The if-else Statement
Comparing Strings
Nested Decision Structures and the if-elif-else Statement
Logical Operators
Boolean Variables
REPETITION STRUCTURES
Introduction to Repetition Structures
The while Loop: A Condition-Controlled Loop
The for Loop: A Count-Controlled Loop
Calculating a Running Total
Sentinels
Input Validation Loops
Nested Loops
VALUE-RETURNING FUNCTIONS AND MODULES
Introduction to Value-Returning Functions: Generating Random Numbers
Writing Your Own Value-Returning Functions
The math Module
Storing Functions in Modules
FILES AND EXCEPTIONS
Introduction to File Input and Output
Using Loops to Process Files
Processing Records
Exceptions
LISTS AND TUPLES
Sequences
Introduction to Lists
List Slicing
Finding Items in Lists with the in Operator
List Methods and Useful Built-in Functions
Copying Lists
Processing Lists
Two-Dimensional Lists
Tuples
MORE ABOUT STRINGS
Basic String Operations
String Slicing
Testing, Searching, and Manipulating Strings
DICTIONARIES AND SETS
Dictionaries
Sets
Serializing Objects
RECURSION
Introduction to Recursion
Problem Solving with Recursion
Examples of Recursive Algorithms
GUI PROGRAMMING
Graphical User Interfaces
Using the tkinter Module
Display Text with Label Widgets
Organizing Widgets with Frames
Button Widgets and Info Dialog Boxes
Getting Input with the Entry Widget
Using Labels as Output Fields
Radio Buttons and Check Buttons
References
1. Tony Gaddis, (2018). Starting Out with Python, 4th Edition. Pearson. ISBN: 9780134652559.
2. Halterman, R. L. (2019). Fundamentals of Python Programming. Richard L. Halterman.
3. Downey, A. B., & Edition, F. (2015). Think Python: How to Think Like a Computer Scientist. Green Tea Press.
4. Barry, P. (2017). Head First Python. 2nd Edition. O’Reilly Media, Inc. ISBN: 9781491919538.
Prepared By
Ts. Dr. Nurulisma Hj. Ismail