[go: up one dir, main page]

0% found this document useful (0 votes)
12 views17 pages

Introduction and Lesson 1

The document outlines an introductory course on Python programming, covering basic and advanced programming structures, object-oriented programming, and Python data structures. It includes a detailed syllabus with 12 lessons, starting from an introduction to Python and IDEs to creating graphics and handling exceptions. By the end of the course, students will have a foundational understanding of programming in Python and be prepared for further study.

Uploaded by

Qombuter Agafari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views17 pages

Introduction and Lesson 1

The document outlines an introductory course on Python programming, covering basic and advanced programming structures, object-oriented programming, and Python data structures. It includes a detailed syllabus with 12 lessons, starting from an introduction to Python and IDEs to creating graphics and handling exceptions. By the end of the course, students will have a foundational understanding of programming in Python and be prepared for further study.

Uploaded by

Qombuter Agafari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
You are on page 1/ 17

Introduction to Python Programming


Course overview

Syllabus

General Introduction to Programming Languages

Programming Environments
Course Overview

In this course you’ll learn


➢Basic Programming Structures



Decision, Loops
➢Advanced topics

Object-oriented programming with classes and exceptions.

Python Data Structures

Python Graphic Elements, Graphic User Interface (GUI)

➢At the end of the course you’ll have a basic grasp of programming – enabling you to
write simple programs in Python as well as prepare you for further study in
programming languages.

2
Syllabus

This course will contain a total of 12 Lessons


and each of the lessons which are:-
➢ Lesson 1: Welcome to Python!
➢ Lesson 2: Get Interactive With Variables and User Input
➢ Lesson 3: Decisions, Decisions
➢ Lesson 4: Looping (and Looping and Looping)
➢ Lesson 5: Modular Programming With Functions
➢ Lesson 6: Introduction to Object-Oriented Programming

3
Syllabus

This course will contain a total of 12 Lessons


and each of the lessons which are:-
➢ Lesson 7: Creating Graphics With Tkinter
➢ Lesson 8: Python Data Structures 1: Lists and Tuples
➢ Lesson 9: Python Data Structures 2: Dictionaries
➢ Lesson 10: Working With External Data Files
➢ Lesson 11: Handling Python Exceptions
➢ Lesson 12: GUIs With Tkinter

4
Syllabus

In each class we will try to finish one Lesson.

Each class will start with a lecture introducing


the topic for the day, exercises and guided
problem solving.

Let’s start with Lesson 1!

5
Lesson 1: Welcome to Python!

Lesson Overview

What is Python?

Introduction to IDE & IDLE

Python Programming In IDLE

Writing your first Program

Review
What is Python?


Developed by Guido van Rossum
higher-level language that enables

programmers to use commands that look like


human language.
What languages can computers understand?


How can a python program be understood by a
computer?
●Compilers and Interpreters.

7
What is Python?


Compilers and Interpreters.
●Compiler:- translates the entire program into
an executable file that can be saved and
distributed to end-users.

C++, Java, C# are compiled languages.
●Interpreter:- translates the high-level code,
one line at a time, as the program runs.

Python is an Interpreted language. Other
languages like JavaScript also use
interpreters.

8
Introducing IDE’s and IDLE


IDE stands for Integrated Development
Environment.
➔ IDE is a program that enables you to both write and run your
Python code within a single application.

In Python, one such environment is called IDLE.
➔There are other IDE’s for Python such as Jupyter, PyCharm, Spyder etc. They
might offer different features but do not affect the basics working of Python.
You can use which ever you like – for the sake of this course we will stick with
IDLE.
IDLE – is clean, simple, and fairly easy to work with, just like Python.

9
Introducing IDE’s and IDLE


Python and IDLE are already installed on the lab
computers.
➔You can download and install it on your personal PC by going to
https://www.python.org/downloads/

To start IDLE – Go to Start and Type IDLE and click on
it.

10
Getting started with IDLE


Open IDLE, and you’ll see a
window with three greater than
signs (>>>). This is the
interpreter prompt.

You can use this window to type
your Python statements at the
prompt and have them
immediately evaluated.

But IDLE offer much more than
this. Look at the menu items at the
top of the window.

11
Writing Your First Program.


To get some practice with this, type
the classic Hello World! program
code. Click in the blank window and
type the following:
➔ print(“Hello World”)

Did you notice the color changes in the
text you typed?

This is one of the nice features of IDLE’s
editor.

It gives you visual cues to help with your
programs.
➔Thishelps with the readability of your code,
especially when it gets longer.

12
Writing Your First Program.


The reason print turned purple is
because it's a keyword (a reserved word)
in Python.
➔That means it has a special meaning, and you
won't be able to use it as a variable name.
Otherwise, Python will get confused and won't be
able to run the code.

The Hello World! text turned green to
designate that the text is a literal string.

In general, a string is just a collection of
letters.
➔This is a literal string because it literally displays
the phrase Hello World! on the screen.

13
Running Your First Program


Now you have your very first Python
program written. Let's run it and see what
it does.

You might think at this point that all you
have to do is click Run > Run Module. The
problem is that Python requires that you
save your program before running it. And
you’ll see the pop up window on the top.

Click Ok and save the file. Give it a name
that’s descriptive.
➔Python will give you another dialog box that
enables you to choose the file name and where it is
to be saved.

14
Running Your First Program

Python will give you another dialog box that enables
you to choose the file name and where it is to be saved.

It’s a good idea to create a new folder someplace
where you'll easily find it, perhaps on the Desktop or in
your Documents folder. Then inside that folder, create a
new folder for each of our lessons in this course.

If you have a flash drive, save your programs on it so
that you can easily access it anywhere.

15
Running Your First Program

> As soon as you save your file IDLE will run you code and
you will see an output like the one in the picture below.
> Notice now how control switches back over to the original
window that you saw when you first opened IDLE.
> Going back and forth between the window where your
program source code is located and the window where your
program runs may seem strange at first, but you'll get used
to it.

16
Lesson 1 Review

> In this lesson, you gained some insight into the


world of Python.
You downloaded and installed the latest version of Python, getting your
computer ready for the programming work you will do throughout this course.
You entered some code and had a chance to work with IDLE a bit. Are you
excited to learn more?
> In the next lesson, you’ll continue your work in
Python by learning about variables and how to code
mathematical operations.
Variables are extremely important because there are many times when you'll
want to keep track of some data while your program runs.

17

You might also like