Session 1 - Introduction to Python

Grade 6 Computer Science

Learning Objectives

1. About Python

Python is a high-level programming language that is easy to learn and use. It was created by Guido van Rossum in 1991. Python is popular because its commands are simple and easy to read.

Uses of Python

2. Installing Python

Follow these steps:

  1. Visit the official Python website: https://www.python.org
  2. Click Downloads.
  3. Download the latest version.
  4. Run the installer.
  5. Tick Add Python to PATH.
  6. Click Install Now.
  7. Wait until installation finishes.

3. Getting Started with Python

After installing Python, open the program called IDLE. IDLE is the place where we write and run Python programs.

>>> print("Hello, World!")

This command displays:

Hello, World!

4. Components of IDLE

Component Purpose
Title Bar Shows the program name.
Menu Bar Contains File, Edit, Run, Help, etc.
Shell Window Where Python commands are typed.
Prompt (>>>) Indicates Python is ready to accept commands.
Output Area Displays the result of commands.

5. Working with Interactive Mode

Interactive Mode lets us type one command at a time and immediately see the result.

Examples

>>> 8 + 5 13

>>> print("Welcome") Welcome

>>> 15 * 4 60

Advantages

Summary

Practice Questions

Choose the Correct Answer

  1. Who developed Python?
  2. What is IDLE used for?
  3. Which symbol is the Python prompt?
  4. Which mode gives immediate output?
  5. Name one use of Python.

Activity

Open Python IDLE and type the following commands:

>>> print("My Name") >>> 25 + 15 >>> 12 * 5