際際滷

際際滷Share a Scribd company logo
INTRODUCTION TO PROGRAMMING
Z genius Academy
Eng./ Ahmed Osman
COURSE CONTENTS
Programming Fundamentals
Why Python ? (Python Fields)
Python Basics
OOP & Functional Programming
Artificial intelligence with applied project
INTRODUCTION
 In Our Course No Any background required.
 Only Need Patience, Desire & Time.
OUR GOAL
 Know Basics of Programming.
 Know Basics of Python.
 Deal with microcontrollers compatible with python (e.x. Raspberry pi).
 Apply a complete real project with python hardware and software.
SMALL INTRODUCTION TO COMPUTER
 Computer is a group of transistors (Switches).
 Know Basics of Python.
 Computer understand only Binary (Machine Language (0,1))
 Initially computer is designed for Mathematical operations, then updated for Logic
operations but still Only understand binary language.
 For Example: ADD operation can be 011 & Subtract: 001.
CONT. SMALL INTRODUCTION TO
COMPUTER
 Computer is a memory Applied operations.
 Memory is Size and Location.
 Unit size of computer memory is byte = 8 bits.
APPEARANCE OF ASSEMBLY LANGUAGE
Is it Logic to coding using binary (Machine Language)?
The answer will be of course Not.
So, we need a transition language between human language and machine language.
This transition language is the Assembly language.
EX: MOV ebx, 4
ASSEMBLY LANGUAGE
But Still is it easy for programmer?
The answer will be of course Not.
APPEARANCE HIGH LEVEL LANGUAGE
For Example:
1) JavaScript.
2) Python.
3) C .
4) C #.
For Example:
Z = x + y == > Python code.
HOW COMPUTER UNDERSTAND CODE
 Computer understand programmer code if written in assembly through Compiler.
 Compiler : its Function is to convert Assembly code  Machine Language.
 Computer understand programmer code if written in high level language through
interpreter or compiler.
 High level language are divided into:
 A) Compiled language. [Your Code Convert into Machine Language] [ Compiler]
 B) Interpreted Language. [Your Code Convert into Byte Code] [ Interpreter]
 Unit size of computer memory is byte = 8 bits.
WHAT IS CODING
 Any code is a solution for certain problem.
 Any problem is :
 1) Data.
 2) Steps.
 3) Solution.
 Any Code is :
 1) Input.
 2) Algorithm.
 3) Output.
WHY LEARN PYTHON
1) Python is free open source .
2) appeared from 21 Years so has a big community.
3) Python is interpreted language.
4) Python contributed in All Fields.
5) Ex: [A.I , Mobile App,Web development, Desktop App, etc. ].
6) Python is a cross platform.
7) In this Course we will concern on A.I Specially Machine learning & Image Processing fields.
OUR TOOLS
Download Pycharm as IDE.
https://www.jetbrains.com/pycharm/download/#section=windows
Download Python.
https://www.python.org/downloads/
OUR FIRST CODE
 How does Python code Execute?
 Python code executes Line by Line from the top.
 Ex:
 Print(Ahmed)
 Print(Osman)
 Print(# * 5 )
 Print(#*5)
VARIABLES
 Data must be stored in form of variables.
 Variable is a place in memory that has name and location.
 Variable must have a value can be accessed by its name.
 Variables have many type according to value of data.
 Ex: Creating aVariable:
X = 5
CONT. VARIABLES
 As we know variable accessed by its Name.
 So, How to name variable?
 Single or Double Quotes
 Case-Sensitive.
 A variable name must start with a letter or the underscore character
 A variable name cannot start with a number.
 A variable name cannot be any of the Python keywords.
 A variable name can only contain alpha-numeric characters and underscores (A-z, 0-
9, and _ )
CONT. VARIABLES
 Many Values to Multiple Variables
 x, y, z = Ahmed", Ali", Mona"
print(x)
print(y)
print(z)
One Value to Multiple Variables
 x = y = z = Ahmed"
CONT. VARIABLES
 Unpack a Collection
Names = [Ahmed", Ali", mohamed"]
x, y, z = fruits
print(x)
print(y)
print(z)
 Value ofVariable
 Often use Print() Function.
GLOBAL VARIABLES
 Variables that are created outside of a function (as in all of the examples above)
are known as global variables.
Global variables can be used by everyone, both inside of functions and outside.
Example:
x = Easy"
def myfunc():
print("Python is " + x)
myfunc()
GLOBAL VARIABLES
 Create a variable inside a function, with the same name as the global variable
x = Easy"
def myfunc():
x = VeryEasy"
print("Python is " + x)
myfunc()
print("Python is " + x)
PYTHON DATA TYPES
Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dict
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray,
memoryview
None Type: NoneType
PYTHON NUMBERS
Int.  Int, or integer, is a whole number, positive or negative, without decimals, of
unlimited length.
Float.  Float, or "floating point number" is a number, positive or negative,
containing one or more decimals.
 Float can also be scientific numbers with an "e" to indicate the power of 10.
Complex.  Complex numbers are written with a "j" as the imaginary part
x = 1 # int
y = 2.8 # float
z = 1j # complex
PYTHON CASTING
 Specify a Variable Type

x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3
PYTHON STRINGS
 Strings in python are surrounded by either single quotation marks, or
double quotation marks.
 'hello' is the same as "hello".
 You can display a string literal with the print() function:
x = int(1) # x will be 1
y = int(2.8) # y will be 2
z = int("3") # z will be 3
 a = ""Python is esay,
it envolves in many projects,
and different fields
ut labore et dolore magna aliqua."""
PYTHON STRINGS
 Strings are Arrays
 a = "Hello, World!"
 print(a[1])
LOOPING THROUGH STRING
 for x in "banana":
 print(x)
 String Length:
 a = "Hello,World!"
 print(len(a))
CHECK STRING
 To check if a certain phrase or character is present in a string, we can use the
keyword in.
 txt = "The best things in life are free!"
if "free" in txt:
print("Yes, 'free' is present.")
txt = "The best things in life are free!"
if "expensive" not in txt:
print("No, 'expensive' is NOT present.")
SLICING STRING
 b = "Hello, World!"
print(b[2:5])
Slice From the Start
b = "Hello, World!"
print(b[:5])
Slice To the End
b = "Hello, World!"
print(b[2:])
NEGATIVE INDEXING
b = "Hello,World!"
print(b[-5:-2])
Use negative indexes to start the slice from
the end of the string:
MODIFY SRING
Python has a set of built-in methods that
you can use on strings.
Upper Case
a = "Hello,World!"
print(a.upper())

More Related Content

Similar to Python-Beginer-PartOnePython is one of the top programming languages in the world, widely used in fields such as AI, machine learning.pptx (20)

python_class.pptx
python_class.pptxpython_class.pptx
python_class.pptx
chandankumar943868
Python Programming Introduction demo.ppt
Python Programming Introduction demo.pptPython Programming Introduction demo.ppt
Python Programming Introduction demo.ppt
JohariNawab
INTRODUCTION TO PYTHON.pptx
INTRODUCTION TO PYTHON.pptxINTRODUCTION TO PYTHON.pptx
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
Python programming
Python programmingPython programming
Python programming
saroja20
PYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptxPYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptx
swarna627082
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
sangeeta borde
#Code2Create: Python Basics
#Code2Create: Python Basics#Code2Create: Python Basics
#Code2Create: Python Basics
GDGKuwaitGoogleDevel
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
Python basics
Python basicsPython basics
Python basics
RANAALIMAJEEDRAJPUT
Introduction-to-Python-print-datatype.pdf
Introduction-to-Python-print-datatype.pdfIntroduction-to-Python-print-datatype.pdf
Introduction-to-Python-print-datatype.pdf
AhmedSalama337512
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
ansariparveen06
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
BASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their ownBASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data science
deepak teja
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdfPy-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
shetoooelshitany74
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Godwin585235
Python slides for the beginners to learn
Python slides for the beginners to learnPython slides for the beginners to learn
Python slides for the beginners to learn
krishna43511
program on python what is python where it was started by whom started
program on python what is python where it was started by whom startedprogram on python what is python where it was started by whom started
program on python what is python where it was started by whom started
rajkumarmandal9391
Python Programming Introduction demo.ppt
Python Programming Introduction demo.pptPython Programming Introduction demo.ppt
Python Programming Introduction demo.ppt
JohariNawab
INTRODUCTION TO PYTHON.pptx
INTRODUCTION TO PYTHON.pptxINTRODUCTION TO PYTHON.pptx
INTRODUCTION TO PYTHON.pptx
Nimrahafzal1
Python programming
Python programmingPython programming
Python programming
saroja20
PYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptxPYTHON PROGRAMMING.pptx
PYTHON PROGRAMMING.pptx
swarna627082
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
2022-23TYBSC(CS)-Python Prog._Chapter-1.pptx
sangeeta borde
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
samiwaris2
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
Gnanesh12
Introduction-to-Python-print-datatype.pdf
Introduction-to-Python-print-datatype.pdfIntroduction-to-Python-print-datatype.pdf
Introduction-to-Python-print-datatype.pdf
AhmedSalama337512
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
ansariparveen06
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdfpython-online&offline-training-in-kphb-hyderabad (1) (1).pdf
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
BASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their ownBASICS OF PYTHON usefull for the student who would like to learn on their own
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
Python introduction towards data science
Python introduction towards data sciencePython introduction towards data science
Python introduction towards data science
deepak teja
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdfPy-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
Py-際際滷s- easuajsjsjejejjwlqpqpqpp1.pdf
shetoooelshitany74
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
notwa dfdfvs gf fdgfgh  s thgfgh frg regggnotwa dfdfvs gf fdgfgh  s thgfgh frg reggg
notwa dfdfvs gf fdgfgh s thgfgh frg reggg
Godwin585235
Python slides for the beginners to learn
Python slides for the beginners to learnPython slides for the beginners to learn
Python slides for the beginners to learn
krishna43511
program on python what is python where it was started by whom started
program on python what is python where it was started by whom startedprogram on python what is python where it was started by whom started
program on python what is python where it was started by whom started
rajkumarmandal9391

Recently uploaded (20)

Adventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil SirAdventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil Sir
GUJARATCOMMERCECOLLE
TPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategyTPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategy
Henry Tapper
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷sReordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Celine George
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
cervical spine mobilization manual therapy .pdf
cervical spine mobilization manual therapy .pdfcervical spine mobilization manual therapy .pdf
cervical spine mobilization manual therapy .pdf
SamarHosni3
Digital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptxDigital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptx
Dr. Sarita Anand
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Essentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok SonawalaEssentials of a Good PMO, presented by Aalok Sonawala
Essentials of a Good PMO, presented by Aalok Sonawala
Association for Project Management
Year 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptxYear 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptx
mansk2
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Rass MELAI : an Internet MELA Quiz Prelims - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George
Kaun TALHA quiz Prelims - El Dorado 2025
Kaun TALHA quiz Prelims - El Dorado 2025Kaun TALHA quiz Prelims - El Dorado 2025
Kaun TALHA quiz Prelims - El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George
Adventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil SirAdventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil Sir
GUJARATCOMMERCECOLLE
TPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategyTPR Data strategy 2025 (1).pdf Data strategy
TPR Data strategy 2025 (1).pdf Data strategy
Henry Tapper
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
PUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health SystemsPUBH1000 Module 3: Public Health Systems
PUBH1000 Module 3: Public Health Systems
Jonathan Hallett
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷sReordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Reordering Rules in Odoo 17 Inventory - Odoo 際際滷s
Celine George
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
cervical spine mobilization manual therapy .pdf
cervical spine mobilization manual therapy .pdfcervical spine mobilization manual therapy .pdf
cervical spine mobilization manual therapy .pdf
SamarHosni3
Digital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptxDigital Tools with AI for e-Content Development.pptx
Digital Tools with AI for e-Content Development.pptx
Dr. Sarita Anand
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
Year 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptxYear 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptx
mansk2
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptxFESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
FESTIVAL: SINULOG & THINGYAN-LESSON 4.pptx
DanmarieMuli1
The Broccoli Dog's inner voice (look A)
The Broccoli Dog's inner voice  (look A)The Broccoli Dog's inner voice  (look A)
The Broccoli Dog's inner voice (look A)
merasan
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George
Database population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slidesDatabase population in Odoo 18 - Odoo slides
Database population in Odoo 18 - Odoo slides
Celine George

Python-Beginer-PartOnePython is one of the top programming languages in the world, widely used in fields such as AI, machine learning.pptx

  • 1. INTRODUCTION TO PROGRAMMING Z genius Academy Eng./ Ahmed Osman
  • 2. COURSE CONTENTS Programming Fundamentals Why Python ? (Python Fields) Python Basics OOP & Functional Programming Artificial intelligence with applied project
  • 3. INTRODUCTION In Our Course No Any background required. Only Need Patience, Desire & Time.
  • 4. OUR GOAL Know Basics of Programming. Know Basics of Python. Deal with microcontrollers compatible with python (e.x. Raspberry pi). Apply a complete real project with python hardware and software.
  • 5. SMALL INTRODUCTION TO COMPUTER Computer is a group of transistors (Switches). Know Basics of Python. Computer understand only Binary (Machine Language (0,1)) Initially computer is designed for Mathematical operations, then updated for Logic operations but still Only understand binary language. For Example: ADD operation can be 011 & Subtract: 001.
  • 6. CONT. SMALL INTRODUCTION TO COMPUTER Computer is a memory Applied operations. Memory is Size and Location. Unit size of computer memory is byte = 8 bits.
  • 7. APPEARANCE OF ASSEMBLY LANGUAGE Is it Logic to coding using binary (Machine Language)? The answer will be of course Not. So, we need a transition language between human language and machine language. This transition language is the Assembly language. EX: MOV ebx, 4
  • 8. ASSEMBLY LANGUAGE But Still is it easy for programmer? The answer will be of course Not.
  • 9. APPEARANCE HIGH LEVEL LANGUAGE For Example: 1) JavaScript. 2) Python. 3) C . 4) C #. For Example: Z = x + y == > Python code.
  • 10. HOW COMPUTER UNDERSTAND CODE Computer understand programmer code if written in assembly through Compiler. Compiler : its Function is to convert Assembly code Machine Language. Computer understand programmer code if written in high level language through interpreter or compiler. High level language are divided into: A) Compiled language. [Your Code Convert into Machine Language] [ Compiler] B) Interpreted Language. [Your Code Convert into Byte Code] [ Interpreter] Unit size of computer memory is byte = 8 bits.
  • 11. WHAT IS CODING Any code is a solution for certain problem. Any problem is : 1) Data. 2) Steps. 3) Solution. Any Code is : 1) Input. 2) Algorithm. 3) Output.
  • 12. WHY LEARN PYTHON 1) Python is free open source . 2) appeared from 21 Years so has a big community. 3) Python is interpreted language. 4) Python contributed in All Fields. 5) Ex: [A.I , Mobile App,Web development, Desktop App, etc. ]. 6) Python is a cross platform. 7) In this Course we will concern on A.I Specially Machine learning & Image Processing fields.
  • 13. OUR TOOLS Download Pycharm as IDE. https://www.jetbrains.com/pycharm/download/#section=windows Download Python. https://www.python.org/downloads/
  • 14. OUR FIRST CODE How does Python code Execute? Python code executes Line by Line from the top. Ex: Print(Ahmed) Print(Osman) Print(# * 5 ) Print(#*5)
  • 15. VARIABLES Data must be stored in form of variables. Variable is a place in memory that has name and location. Variable must have a value can be accessed by its name. Variables have many type according to value of data. Ex: Creating aVariable: X = 5
  • 16. CONT. VARIABLES As we know variable accessed by its Name. So, How to name variable? Single or Double Quotes Case-Sensitive. A variable name must start with a letter or the underscore character A variable name cannot start with a number. A variable name cannot be any of the Python keywords. A variable name can only contain alpha-numeric characters and underscores (A-z, 0- 9, and _ )
  • 17. CONT. VARIABLES Many Values to Multiple Variables x, y, z = Ahmed", Ali", Mona" print(x) print(y) print(z) One Value to Multiple Variables x = y = z = Ahmed"
  • 18. CONT. VARIABLES Unpack a Collection Names = [Ahmed", Ali", mohamed"] x, y, z = fruits print(x) print(y) print(z) Value ofVariable Often use Print() Function.
  • 19. GLOBAL VARIABLES Variables that are created outside of a function (as in all of the examples above) are known as global variables. Global variables can be used by everyone, both inside of functions and outside. Example: x = Easy" def myfunc(): print("Python is " + x) myfunc()
  • 20. GLOBAL VARIABLES Create a variable inside a function, with the same name as the global variable x = Easy" def myfunc(): x = VeryEasy" print("Python is " + x) myfunc() print("Python is " + x)
  • 21. PYTHON DATA TYPES Text Type: str Numeric Types: int, float, complex Sequence Types: list, tuple, range Mapping Type: dict Set Types: set, frozenset Boolean Type: bool Binary Types: bytes, bytearray, memoryview None Type: NoneType
  • 22. PYTHON NUMBERS Int. Int, or integer, is a whole number, positive or negative, without decimals, of unlimited length. Float. Float, or "floating point number" is a number, positive or negative, containing one or more decimals. Float can also be scientific numbers with an "e" to indicate the power of 10. Complex. Complex numbers are written with a "j" as the imaginary part x = 1 # int y = 2.8 # float z = 1j # complex
  • 23. PYTHON CASTING Specify a Variable Type x = int(1) # x will be 1 y = int(2.8) # y will be 2 z = int("3") # z will be 3
  • 24. PYTHON STRINGS Strings in python are surrounded by either single quotation marks, or double quotation marks. 'hello' is the same as "hello". You can display a string literal with the print() function: x = int(1) # x will be 1 y = int(2.8) # y will be 2 z = int("3") # z will be 3 a = ""Python is esay, it envolves in many projects, and different fields ut labore et dolore magna aliqua."""
  • 25. PYTHON STRINGS Strings are Arrays a = "Hello, World!" print(a[1])
  • 26. LOOPING THROUGH STRING for x in "banana": print(x) String Length: a = "Hello,World!" print(len(a))
  • 27. CHECK STRING To check if a certain phrase or character is present in a string, we can use the keyword in. txt = "The best things in life are free!" if "free" in txt: print("Yes, 'free' is present.") txt = "The best things in life are free!" if "expensive" not in txt: print("No, 'expensive' is NOT present.")
  • 28. SLICING STRING b = "Hello, World!" print(b[2:5]) Slice From the Start b = "Hello, World!" print(b[:5]) Slice To the End b = "Hello, World!" print(b[2:])
  • 29. NEGATIVE INDEXING b = "Hello,World!" print(b[-5:-2]) Use negative indexes to start the slice from the end of the string:
  • 30. MODIFY SRING Python has a set of built-in methods that you can use on strings. Upper Case a = "Hello,World!" print(a.upper())