Students will:
- Use IDLE to test Python expressions and statements in the interactive shell.
- Code, test, and debug programs
- Use pseudocode to plan your control structures and programs
- Define and use functions, default values, named arguments, local variables, and global variables
- Plan the test runs for a program
- Use lists and tuples in your programs
- Use text, CSV, or binary files to save and retrieve data
- Add the proper level of exception handling
- Code, test, and debug programs that work with numbers
- Code, test, and debug programs that work with strings
- Code, test, and debug programs that work with dates and times
Course Outline:
Lesson 1: An Introduction to Python Programming
This chapter starts by showing why Python is considered by many to be the best language for teaching beginners how to program. Next, this chapter presents the concepts and terms that you need to know before you start programming. Then, it shows how to use an integrated development environment (IDE) called IDLE to develop and test Python programs.
Lesson 2: How to Write your First Programs
The quickest and best way to learn Python programming is to do Python programming. That’s why this chapter shows you how to write complete Python programs that get input, process it, and display output. When you finish this chapter, you’ll have the skills for writing comparable programs of your own.
Lesson 3: How to Code Control Statements
Like all programming languages, Python provides control statements that let you control the execution of a program. These statements include if statements as well as looping statements. Before you can learn how to use these statements, though, you need to learn how to code Boolean expressions
Lesson 4: How to Define and Use Functions and Modules
In chapter 2, you learned how to use some of Python’s built-in functions, such as the print() and input() functions. In this chapter, you’ll learn how to define and use your own functions. You’ll also learn how to store your functions in modules and how to use modules that have been created by others.
Lesson 5: How to Test and Debug a Program
If you’ve been doing the exercises and writing your own programs, you already have some experience with testing and debugging. Now, this chapter reviews some of what you’ve been experiencing and presents some new skills for testing and debugging. As your programs become more complicated, these testing and debugging skills become more valuable.
Lesson 6: How to Work with Lists and Tuples
So far, you have learned how to work with variables that store a single item of data such as a number or a string. However, in programming, you often need to store a collection of data items. For example, you might need to store a collection of strings or a collection of numbers. This chapter teaches you how to work with two of Python’s data structures for collections: lists and tuples.
Lesson 7: How to Work with File I/O
So far in this book, you’ve learned how to work with data in the main memory of your computer. But when the program ends, that data is lost. Now, you’ll learn how to save that data in a file and how to read that data from the file. This is known as file input and output, or file I/O.
Lesson 8: How to Handle Exceptions
In chapter 1, you were introduced to exceptions. By now, you have most likely experienced many of them as you developed and tested your programs. In this chapter, you will learn how to handle exceptions so your programs don’t crash when an exception occurs
Lesson 9: How to Work with Numbers
In previous chapters, you learned the basics of working with numbers, including how to initialize numeric variables, how to use arithmetic expressions, and how to compare numeric values. In this chapter, you’ll learn more about working with numbers, including how to format them and how to avoid floating-point errors by using decimal numbers.
Lesson 10: How to Work with Strings
In chapter 2, you learned some basic skills for working with strings, including how to create a string, how to concatenate strings, and how to work with escape characters. Now, in this chapter, you’ll expand that set of skills.
Lesson 11: How to Work with Dates and Times
In the last two chapters, you learned how to work with two of the essential data types: numbers and strings. Now, you’ll learn how to work with a third essential type: dates and times. These skills are important because you use dates and times in most applications, from business applications to games.