0% found this document useful (0 votes)
13 views6 pages

ICT M1 Lesson 6 & 7

The document provides an overview of Python programming, including its definition, features, and how to download it. It discusses the principles of variables in Python, including naming conventions and types such as numbers, strings, and booleans. Additionally, it includes questions and exercises to reinforce understanding of the material.

Uploaded by

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

ICT M1 Lesson 6 & 7

The document provides an overview of Python programming, including its definition, features, and how to download it. It discusses the principles of variables in Python, including naming conventions and types such as numbers, strings, and booleans. Additionally, it includes questions and exercises to reinforce understanding of the material.

Uploaded by

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

Date / / .

Sixth Lesson
Principles of python

Definition of python

Python programing language was released in 1991 (first version).

Python Features

Features
Open source ----- Free and open source

Interpreted language------translates programming code line by line. Programmers can


quickly find errors in the code.

Versatility------web application – data science – AI – machine learning – game


programming.

Easy to use ------one of the easiest programming language for beginners because its
simple and organized uses English words.

Libraries-----python uses many libraries they are pre-built codes and functions that
help programmers perform specific tasks without having to write codes from scratch,
libraries are a powerful tool that increases the efficiency and effectiveness of
programming using Python, as they provide ready-made solutions to many common
problems or requirements. such as

Python libraries

NumPy Panda Matplotlib

Data Data Data Charts


Statistics AI Graphs
science Analysis Processing Creation Creation

How to download the program from the official website

1. Visit the official Python website www.python.org


2. Choose “Download”
3. Then choose the system you are working on (Windows, Mac, or Linux).
4. You must choose 64 bit or 32 bit, according to your device specifications.
5. After downloading, install the program on your device and follow the instructions.

2
Questions
Put ( √ ) or ( X )

1. Python is a free and open-source language, which does not allow anyone to develop
it.
2. It is not permissible to create applications and websites in Python.
3. Python uses data science and machine learning.
4. Python is an interpreted language because it translates programming codes line by
line.
5. Python is used in developing web applications, data science, artificial intelligence,
machine learning, and game programming.
6. Python can be integrated with other languages such as C, C++, and Java. ( )
7. One of the disadvantages of Python is the lack of libraries that you can use.
8. Python is one of the most difficult programming languages.
9. NumPy: A library used in data science, statistics, and artificial intelligence.
10. Pandas: A library for analyzing and processing data.

Download Python from the official website and arrange the following steps in the
correct order.

1- You must choose 64bit or 32bit, depending on your device specifications.

2- Visit the official Python website www.python.org

3- Choose the system you are working on (Windows, Mac, or Linux).

4- After downloading, install the program on your device and follow the instructions.

5- Choose "Downloads"

3
Date / / .
Seventh Lesson
Variables in python

Variables in programming languages

A reserved place in memory to store and save a specific value, where the value can change

example: Taher= 20

A variable named (Taher)

Its value is equal to (20),

Where you can change the value of the variable while dealing with the program
immediately during the execution of the program.

Conditions for naming variables in Python

1. The variable name begins with a letter or an underscore.

2. The change name contains letters (A-Z) or numbers or an underscore.

3. Reserved words may not be used in Python because they express specific values that
the program understands

Example:

(False) A reserved word within the program is a word that indicates a reserved value
(logical value).

Note : When writing a variable name, you must take into account placing the variable
names in upper and lowercase letters

TAHER, Taher, taher, TaheR

In the previous example, the variable names refer to four variables and not one variable.

4
Types of variables in Python

1. Numbers: Used to store numerical values such as integers (int) and decimals (float).

Integer variables: X= 5
(int) Y= 10
Decimal variables: Z= 5.25
(float) A= 8.32
2. Strings: Used to store texts such as names and addresses.

Texts are placed between single quotes ‘ ’ or double quotes “ ”

Textual variable: Name = “Taher”


( String ) City = ‘Cairo’
3. Booleans: A data type that contains only two values True or False often used in
comparisons and decision making in codes

Boolean variables: Is_taher_student = False


Is_taher_a_teacher = True

Type ( )function To know the type of the variable

The print function ( ) in Python is one of the most commonly used functions, used to
display text or values on the output screen.

It can be used to display text, variables, or even the results of mathematical operations.

Note: The interactive Python interface is installed when you install the Python language,
and there is no need to download it, unlike a text editor that must be downloaded from the
Internet, such as Visual Studio and PyCharm.

5
Questions
Put ( √ ) or ( X )

1. Variables in programming languages are a reserved place in memory to store and


save a specific value.
2. The variable name must not begin with a letter or an underscore sign _. ( )
3. TAHER, Taher, taher, TaheR are 4 names for variables in the Python language.
4. The change name contains letters (A-Z) or numbers or an underscore sign
5. When naming variables, reserved words in the Python language may be used
6. Y= 10 The statement type of the variable Y is numeric for an integer
7. City = “Cairo” The statement type of the variable City is text
8. Is_taher_student = False The statement type of the variable Is_taher_student is
logical.
9. To know the type of the variable, we do not need to use the type ( ) function.
10. The texts of variables are placed between single quotation marks ‘ ’ or double
quotation marks “ ”.

Choose the correct answer from the following.

1. The function ..... is used to display texts or values on the output screen

A. Cos( ) B. Type( ). C. Print( ). D. Sin( ).

2. The text value of the variable is placed between the signs .....

A. "" B. <>. C. >=. D. =

3.To display texts, variables, or even the results of mathematical operations, we use
the function .....

A. Cos( ) B. Type( ). C. Print( ). D. Sin( ).

4. To know the type of the variable statement, we use the function .....

A. Cos( ) B. Type( ). C. Print( ). D. Sin( ).

You might also like