0% found this document useful (0 votes)
13 views

python basics slides

The document serves as an introduction to programming in Python 3.x, covering essential topics such as data types, operators, decision statements, loops, functions, and modules. It outlines the structure of a Python script, the importance of syntax, and various data types including numeric, string, boolean, sequence, mapped data, and binary data. Additionally, it emphasizes the significance of commenting code and provides an overview of different operators used in Python.

Uploaded by

sourav ganguly
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 views

python basics slides

The document serves as an introduction to programming in Python 3.x, covering essential topics such as data types, operators, decision statements, loops, functions, and modules. It outlines the structure of a Python script, the importance of syntax, and various data types including numeric, string, boolean, sequence, mapped data, and binary data. Additionally, it emphasizes the significance of commenting code and provides an overview of different operators used in Python.

Uploaded by

sourav ganguly
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/ 54

Introduction to

Programming in
Python3.x
Python3
Python3
Python3

Project Datatypes

OOP Operators

Modules Decision Statement

Functions Loops

File manipulation Control statements


Your First Program
• Python script – text file with ‘.py’ extension.
• Can be opened by any text editor.
• Filename has restrictions
• Can only use alpha-numerics, underscores,
hyphen and period.
• Cannot start with a digit
• No other special characters.
• Special words – reserved for pythons usage.
• Look at some of them and their uses as we move
forward.
• “print” is one such word.
• Commenting the code is an essential skill.
• # indicates comment – wont be read by the
interpreter
• ‘’’ ‘’’ – multi line comment
Your First Program
Python3

Project Datatypes

OOP Operators

Modules Decision Statement

Functions Loops

File manipulation Control statements


Datatypes

What are we going to do?


On an very simple language
•Work with numbers (Both integers and floats)
•Work with alphabets
•Read & write data from and into files (Eg: images, text files, stl files, etc…)

To do that we follow certain rules and regulations. We call them as syntax.

Each language has its own syntax, but the basic logic behind them is almost similar to each
other.
Datatypes
Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > Numeric

•Variables – like postal addresses in a village


•Variable – name for the location in memory
•Types of numbers
•Integers
•Floats
•Complex Numbers
•Complex implementation uses only ‘j’
•No space between the imginary No. and ‘j’
Datatypes
Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > String
Datatypes
Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > Boolean
Datatypes
Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > Numeric String Boolean
Datatypes > Numeric String Boolean
Datatypes

Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > List
Datatypes > List
Datatypes > Tuple
Datatypes > Tuple
Datatypes

Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Datatypes > Mapped Data
Datatypes > Mapped Data
Datatypes

Numeric - Integer, Floats, Complex Numbers

String - Alphabets

Boolean - True or False

Sequence - List , Tuple

Mapped Data - Dictionary

Binary Data - bytes, bytearray


Python3

Project Datatypes

OOP Operators

Modules Decision Statement

Functions Loops

File manipulation Control statements


Operators

Arithmetic Operator

Assignment Operator

Comparison Operator

Logical Operator

Bitwise Operator

Identity Operator
Operators > Arithmetic Operator
Operators > Arithmetic Operator
Operators > Assignment Operator
Operators > Assignment Operator
Operators > Comparison Operator
Operators > Comparison Operator
Operators

Arithmetic Operator

Assignment Operator

Comparison Operator

Logical Operator

Bitwise Operator

Identity Operator
Python3

Project Datatypes

OOP Operators

Modules Decision Statement

Functions Loops

File manipulation Control statements


Decision Statement
Decision Statement
Decision Statement
Python3

Project Datatypes

OOP Operators

Modules Decision Statement

Functions Loops

File manipulation Control statements


Loops > ‘for’
Loops > ‘for’
Loops > ‘while’
Loops > ‘while’
Python3

Project Datatypes

OOP Operators

File manipulation Decision Statement

Modules Loops

Functions Control statements


Python3
Python3

Project Datatypes

OOP Operators

File manipulation Decision Statement

Modules Loops

Functions Control statements


Python3 > Functions
Python3 > Functions
Python3

Project Datatypes

OOP Operators

File manipulation Decision Statement

Modules Loops

Functions Control statements


Python3 > Modules
Python3 > Modules
Python3

Project Datatypes

OOP Operators

File manipulation Decision Statement

Modules Loops

Functions Control statements

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy