Intro to Python
Intro to Python
python
present by:
Nadia Nairat
Overview
• what is python.
• Data types
• variables
• syntax error
• How to get an input from the
user?
What's python?
python
is:
Python is an
interpreted, object-
oriented, high-
level programming
language with
dynamic
case-sensitive
semantics.
if you write:
a not the same to
A
• why you
should learn
python? • where it can
where it can be
used:
• a clear easy code
be used?
to understand .
• we can easily
change and play
with a sires of • AI and machine
code . learning
• it can work with • web development
any operation • game development
system. • data visualization
• data analytics
• language
development
Data types:
1- Numbers
2- String, ex: "Rahaf"
3- List, ex: ["Lama", 2, "Ahmed",
4]
4- Tuple, ex: ("Lama", 2,
"Ahmed", 4)
5- Dictionary, ex: {"Ghala":19}
variable
s:
variables How to declare a variable ?
are piece of information Nameofvariable = theexpression or
that can the value
change in a later Ex: y = 56 or 4*7
statement. A python Note: in programming languages we
variable is a reserved used one equal sign ( = ) to assign
values to variables. It doesn’t mean
memory location to store
equality as in algebra we used 2 equal
values. sign ( == ) to indicate an equality, ex:
if ( x==2 )
Rules for creating variables in Python:
Exampels:
Missing symbols (such as comma, bracket, c
olon), misspelling a keyword, having incorrec
t indentation
.are common syntax errors in python.
How can we get an
input from the user: Variable = input (“ ” )
Ex: age = input (“Enter your age”)
•len("hello") 5 # size