You are on page 1of 24

PYTHON BASICS

Caterpillar: Confidential Green


Day 1 Agenda
• Introduction of Python
– Features of Python
– Tech companies using Python
– Python implementation in various domains
• Variables , Identifiers , Standard Datatypes
• Operators
• Conditional statements
• Loops

Caterpillar: Confidential Green


Features of Python
• 4G High level language written by Guido Van Rossum. Made public in 1991.
• Platform independent
• Portable
• Scripting language
• Combination of Procedure oriented and Object oriented
• Extensible
• Vast library source
• Highly Productive

Caterpillar: Confidential Green


• YouTube ,
• Google search engine,
• Dropbox ,
• RasberryPi
• BitTorrent ,
• NASA ( cryptography and intelligence Analysis ), Netflix

Caterpillar: Confidential Green


• Web Development
• Testing
• Computer Vision
• Machine Learning
• Artificial Intelligence
• Deep Learning
• Natural Language Processing ( NLP)

Caterpillar: Confidential Green


Installation of Python
• Install Python 3.x version
• Python 2.x will not be supported from 2020 Jan.
• Installing Modules command
• Help on Modules

Caterpillar: Confidential Green


• Variables
Unlike other languages variables are tags
Everything is an object and hence efficient memory utilization
Identifiers
A to Z , a to z , underscore(_letters or digits)
special chars are not allowed @,$

Caterpillar: Confidential Green


Standard Datatypes

Caterpillar: Confidential Green


Standard Datatypes – Immutable Types
• Numeric types
– int , float,complex
– a=5, b=5.55 , c=10+5j
– A binary number should be written by prefixing 0b (zero and b) or 0B (zero and B) before
the value. For example, 0b110110, 0B101010011 are treated as binary numbers.
– Hexadecimal numbers are written by prefixing 0x (zero and x) or 0X (zero and big X)
before the value, as 0xA180 or 0X11fb91 etc.
– Similarly, octal numbers are indicated by prefixing 0o (zero and small o) or 0O (zero and
then O) before the actual value.
– For example, 0O145 or 0o773 are octal values.

Caterpillar: Confidential Green


Standard Datatypes – Immutable Types
• String Type
• Tuples

10

Caterpillar: Confidential Green


Standard Datatypes – Mutable Types
• Lists
• Dictionaries
• Sets

11

Caterpillar: Confidential Green


Arithmetic Operators

12

Caterpillar: Confidential Green


Assignment Operators

13

Caterpillar: Confidential Green


Comparison Operators

14

Caterpillar: Confidential Green


Logical Operators

15

Caterpillar: Confidential Green


Bitwise Operators

16

Caterpillar: Confidential Green


Bitwise Operators

17

Caterpillar: Confidential Green


Bitwise Operators

18

Caterpillar: Confidential Green


19

Caterpillar: Confidential Green


Bitwise Operators

20

Caterpillar: Confidential Green


Bitwise Operators

21

Caterpillar: Confidential Green


22

Caterpillar: Confidential Green


Conditional Statements
• If
• Elif
• else

23

Caterpillar: Confidential Green


Loops
• For loop
• While loop

24

Caterpillar: Confidential Green

You might also like