SlideShare a Scribd company logo
Jyoti Shukla, SME
Copyright 2020 @SquadInfotech,
All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
 General purpose high level programming/
scripting language
 Invented by Guido Van Rossam
 Combination of:
◦ Functional programming Language from C
◦ OOPS concept from C++.
◦ Scripting language from perl and shell script
◦ Modular programming language from Modula-3.
Copyright 2020 @SquadInfotech, All rights reserved.
 Open Source
 Platform Independent
 Portable
 Simple and easy to learn
 Dynamically Typed
 Interpreted Language
 Extensible
 Broad Standard Library
 Supports both function oriented concept and
object oriented concept
Copyright 2020 @SquadInfotech, All rights reserved.
 Desktop application
 Web applications
 Database Application
 Networking applications
 Games
 Data analysis
 Machine Language
 Artificial Intelligence
Copyright 2020 @SquadInfotech, All rights reserved.
 Google
 YouTube
 Dropbox
 NASA
 and many more
Copyright 2020 @SquadInfotech, All rights reserved.
Link: https://www.python.org/downloads/
Copyright 2020 @SquadInfotech, All rights reserved.
 Python 3.8.2 introduced in 24 Feb 2020
 ..
 Python 3.8 introduced in 14 Oct 2019
 ....
 Python 3.0 introduced in Dec 2008
 Python 2.0 introduced in October 2000
 Python 1.0 introduced in Jan 1994
Python is not backward compatible.
Copyright 2020 @SquadInfotech, All rights reserved.
 There are 33 reserve keywords in python.
'False', 'None', 'True', 'and', 'as', 'assert', 'break',
'class', 'continue', 'def', 'del', 'elif', 'else',
'except', 'finally', 'for', 'from', 'global', 'if',
'import', 'in', 'is', 'lambda', 'nonlocal', 'not',
'or', 'pass', 'raise', 'return', 'try', 'while', 'with',
'yield'
Copyright 2020 @SquadInfotech, All rights reserved.
 Only A-Z, a-z and 0-9 can be used to create
an identifier but shouldn't start with a digit.
 Identifiers are Case Sensitive.
 Reserve Keywords are not allowed as
Identifiers.
 No long limit.
 Only underscore ‘_’, a special character is
allowed in an identifier.
 Eg: counter, counter1, arr_count etc
Copyright 2020 @SquadInfotech,
All rights reserved.
 Int
 Float
 Complex
 Bool
 Str
 Bytes
 Bytearray
 Range
 List
 Tuple
 Set
 Frozenset
 Dict
 None
Copyright 2020 @SquadInfotech, All rights reserved.
 Function for type casting
 int()
 float()
 complex()
 bool()
 str()
Copyright 2020 @SquadInfotech,
All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
• Arithmetic operators
• Assignment operators
• Comparison operators
• Logical operators
• Identity operators
• Membership operators
• Bitwise operators
 + Addition (x + y)
 - Subtraction (x – y)
 * Multiplication (x * y)
 / Division (x / y)
 % Modulus (x % y)
 ** Exponentiation (x ** y)
 // Floor division (x // y)
Copyright 2020 @SquadInfotech,
All rights reserved.
Copyright 2020 @SquadInfotech,
All rights reserved.
 = x = 5 (x = 5)
 += x+=5 (x = x + 5)
 -= x -= 5 (x = x – 5)
 *= x *= 5 (x = x * 5)
 /= x /= 5 (x = x / 5)
 %= x %= 5 (x = x % 5)
 //= x //= 5 (x = x // 5)
 **= x **= 5 (x = x ** 5)
 &= (x &= 5) (x = x & 5)
 |= x |= 5 (x = x | 5)
^= x ^= 5 (x = x ^ 5)
 > (Greater than)
 < (Lesser than)
 == (Equal to )
 != (Not equal to)
 >= (Greater than or equal to)
 <= (Less than or equal to)
Copyright 2020 @SquadInfotech,
All rights reserved.
and := if both values are true then only result
is true
Or:=True if either of the operands is true
Not:= complement
Copyright 2020 @SquadInfotech,
All rights reserved.
 & Bitwise AND
 |Bitwise OR
 ~Bitwise NO
 ^Bitwise XOR
 >>Bitwise right shift
 <<Bitwise left shift
Copyright 2020 @SquadInfotech,
All rights reserved.
 are used to test whether a value or variable is
found in a sequence
(string, list, tuple, set and dictionary).
 In:=True if value/variable is found in the
sequence
 Not in:=True if value/variable is not found in
the sequence
Copyright 2020 @SquadInfotech,
All rights reserved.
 They are used to check if two values (or
variables) are located on the same part of the
memory. Two variables that are equal does
not imply that they are identical.
 is :=True if the operands are identical (refer
to the same object)
 is not := True if the operands are not
identical (do not refer to the same object)
Copyright 2020 @SquadInfotech,
All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
Copyright 2020 @SquadInfotech,
All rights reserved.
Syntax Example (Odd Even)
Syntax:
if condition:
#code
else:
#code
num= int(input("Enter
the number to check:
"))
if num%2 is 0:
print("even number")
else:
print("odd number")
Copyright 2020 @SquadInfotech, All rights reserved.
Syntax Example
if condition:
#code
if condition:
#code
else:
#code
else:
#code
per=int(input("Enter your
percentage: "))
if per >= 60:
exp= int(input("Enter the
number of experience: "))
if exp >= 2:
print("eligible for job")
else:
print("not eligible for job")
else:
print("not qualified“)
Copyright 2020 @SquadInfotech, All rights reserved.
Syntax Example
if condition:
#code
elif condition:
#code
elif condition:
#code
else:
#code
per= int(input("Enter your
percentage: “))
if per >= 90:
print("A grade")
elif per >=70 and per<90:
print("B grade")
elif per >=50 and per<70:
print(“C grade")
else:
print(“Be positive, Work
hard")
Copyright 2020 @SquadInfotech, All rights reserved.
Syntax Example
while (condition):
#code
num=int(input(“Enter a
number: "))
counter=1
print(“Below are even
numbers: ”)
while counter<=num:
if counter%2==0:
print(counter)
counter+=1
Copyright 2020 @SquadInfotech, All rights reserved.
Syntax Example
for counter in range
(lower limit,
upper limit,
[increment factor]):
#code
for i in range(1,5):
# default increment is1
print(i)
for i in range(5,0,-1):
#decrementing by -1
print(i, end=“ ”)
Copyright 2020 @SquadInfotech, All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
 Strings are arrays of bytes representing
Unicode characters.
 Python does not have a character data type.
 A single character is simply a string with a
length of 1.
 Square brackets can be used to access
elements of the string.
 Strings can be created using single, double or
even triple quotes.
Copyright 2020 @SquadInfotech, All rights reserved.
Copyright 2020 @SquadInfotech,
All rights reserved.
 String in single quotes cannot hold any other
single quoted character in it because the
compiler won’t recognize where to start and
end the string.
 To overcome this error, double quotes is
preferred, because it helps in creation of
Strings with single quotes in them.
 For strings which contain Double quoted
words in them, use of triple quotes is
suggested. Along with this, triple quotes also
allow the creation of multiline strings.
Copyright 2020 @SquadInfotech, All rights reserved.
Single Quote
Double Quoted string has
a Single Quote
# Creation of String
# with single Quotes
str1 = 'Welcome to the
Coder Technologies‘
print(str1)
# Creating a String
# with double Quotes
str2 = "I'm learning
python“
print(str2)
Copyright 2020 @SquadInfotech, All rights reserved.
Triple Quotes
Multiline with Triple
quotes
# Creating a String
# with triple Quotes
str3 = ‘’’I'm learning
python and I’m lovin’
it’’’
print(str3)
# Creating multiline
# strings
str4 = '''hi
how are you?
This lockdown is so
boring! '''
print(str4)
Copyright 2020 @SquadInfotech, All rights reserved.
 Access characters within a string
 Concatenating
 Iterating
 Formatting
 Built-in string methods
Copyright 2020 @SquadInfotech, All rights reserved.
Copyright 2020 @SquadInfotech, All rights reserved.
There are four collection data types:
 List: Ordered and changeable. Allows
duplicate members.
 Tuple: Ordered and unchangeable. Allows
duplicate members.
 Set: Unordered and un-indexed. No duplicate
members.
 Dictionary: Unordered, changeable and
indexed. No duplicate members.
Copyright 2020 @SquadInfotech, All rights reserved.

More Related Content

What's hot (20)

PPTX
Basics of python
SurjeetSinghSurjeetS
 
PPTX
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
PPT
Python ppt
Mohita Pandey
 
PPTX
Introduction to python
Ayshwarya Baburam
 
PPTX
Introduction to python
AnirudhaGaikwad4
 
PDF
Introduction to python programming
Srinivas Narasegouda
 
PDF
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Edureka!
 
PPTX
Python Scipy Numpy
Girish Khanzode
 
PPTX
Python 3 Programming Language
Tahani Al-Manie
 
PDF
Python
대갑 김
 
PPTX
Python Tutorial Part 1
Haitham El-Ghareeb
 
PDF
Let’s Learn Python An introduction to Python
Jaganadh Gopinadhan
 
PPTX
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
 
PDF
Python - the basics
University of Technology
 
PPT
Intro to Python
primeteacher32
 
PPTX
Python
Gagandeep Nanda
 
PDF
Python final ppt
Ripal Ranpara
 
PDF
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
Basics of python
SurjeetSinghSurjeetS
 
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
Python ppt
Mohita Pandey
 
Introduction to python
Ayshwarya Baburam
 
Introduction to python
AnirudhaGaikwad4
 
Introduction to python programming
Srinivas Narasegouda
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Edureka!
 
Python Scipy Numpy
Girish Khanzode
 
Python 3 Programming Language
Tahani Al-Manie
 
Python
대갑 김
 
Python Tutorial Part 1
Haitham El-Ghareeb
 
Let’s Learn Python An introduction to Python
Jaganadh Gopinadhan
 
Python | What is Python | History of Python | Python Tutorial
QA TrainingHub
 
Python - the basics
University of Technology
 
Intro to Python
primeteacher32
 
Python final ppt
Ripal Ranpara
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 

Similar to Python basics (20)

PPTX
Python introduction towards data science
deepak teja
 
PDF
Python-01| Fundamentals
Mohd Sajjad
 
PDF
What is Python?
wesley chun
 
PPTX
Introduction on basic python and it's application
sriram2110
 
PPTX
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Marco Parenzan
 
PPTX
Welcome to python workshop
Mukul Kirti Verma
 
PDF
Data Structure and Algorithms (DSA) with Python
epsilonice
 
PPTX
11 Unit 1 Chapter 03 Data Handling
Praveen M Jigajinni
 
PPT
Introduction-to-Csharpppppppppppppppp.ppt
kamalsmail1
 
PDF
How To Tame Python
Mohd Anwar Jamal Faiz
 
PDF
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
PPTX
python ppt | Python Course In Ghaziabad | Scode Network Institute
Scode Network Institute
 
PDF
Python_Unit_1.pdf
alaparthi
 
PPTX
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
PPTX
Chapter 10 data handling
Praveen M Jigajinni
 
PPT
devLink - What's New in C# 4?
Kevin Pilch
 
PPT
Cpp tokens (2)
Kamlesh Makvana
 
PPT
Python Part 1
Sunil OS
 
PPTX
Introduction to learn and Python Interpreter
Alamelu
 
PPTX
Python Introduction
vikram mahendra
 
Python introduction towards data science
deepak teja
 
Python-01| Fundamentals
Mohd Sajjad
 
What is Python?
wesley chun
 
Introduction on basic python and it's application
sriram2110
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Marco Parenzan
 
Welcome to python workshop
Mukul Kirti Verma
 
Data Structure and Algorithms (DSA) with Python
epsilonice
 
11 Unit 1 Chapter 03 Data Handling
Praveen M Jigajinni
 
Introduction-to-Csharpppppppppppppppp.ppt
kamalsmail1
 
How To Tame Python
Mohd Anwar Jamal Faiz
 
python-online&offline-training-in-kphb-hyderabad (1) (1).pdf
KosmikTech1
 
python ppt | Python Course In Ghaziabad | Scode Network Institute
Scode Network Institute
 
Python_Unit_1.pdf
alaparthi
 
Python (Data Analysis) cleaning and visualize
IruolagbePius
 
Chapter 10 data handling
Praveen M Jigajinni
 
devLink - What's New in C# 4?
Kevin Pilch
 
Cpp tokens (2)
Kamlesh Makvana
 
Python Part 1
Sunil OS
 
Introduction to learn and Python Interpreter
Alamelu
 
Python Introduction
vikram mahendra
 
Ad

Recently uploaded (20)

PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Ad

Python basics

  • 1. Jyoti Shukla, SME Copyright 2020 @SquadInfotech, All rights reserved.
  • 2. Copyright 2020 @SquadInfotech, All rights reserved.
  • 3. Copyright 2020 @SquadInfotech, All rights reserved.
  • 4.  General purpose high level programming/ scripting language  Invented by Guido Van Rossam  Combination of: ◦ Functional programming Language from C ◦ OOPS concept from C++. ◦ Scripting language from perl and shell script ◦ Modular programming language from Modula-3. Copyright 2020 @SquadInfotech, All rights reserved.
  • 5.  Open Source  Platform Independent  Portable  Simple and easy to learn  Dynamically Typed  Interpreted Language  Extensible  Broad Standard Library  Supports both function oriented concept and object oriented concept Copyright 2020 @SquadInfotech, All rights reserved.
  • 6.  Desktop application  Web applications  Database Application  Networking applications  Games  Data analysis  Machine Language  Artificial Intelligence Copyright 2020 @SquadInfotech, All rights reserved.
  • 7.  Google  YouTube  Dropbox  NASA  and many more Copyright 2020 @SquadInfotech, All rights reserved.
  • 9.  Python 3.8.2 introduced in 24 Feb 2020  ..  Python 3.8 introduced in 14 Oct 2019  ....  Python 3.0 introduced in Dec 2008  Python 2.0 introduced in October 2000  Python 1.0 introduced in Jan 1994 Python is not backward compatible. Copyright 2020 @SquadInfotech, All rights reserved.
  • 10.  There are 33 reserve keywords in python. 'False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield' Copyright 2020 @SquadInfotech, All rights reserved.
  • 11.  Only A-Z, a-z and 0-9 can be used to create an identifier but shouldn't start with a digit.  Identifiers are Case Sensitive.  Reserve Keywords are not allowed as Identifiers.  No long limit.  Only underscore ‘_’, a special character is allowed in an identifier.  Eg: counter, counter1, arr_count etc Copyright 2020 @SquadInfotech, All rights reserved.
  • 12.  Int  Float  Complex  Bool  Str  Bytes  Bytearray  Range  List  Tuple  Set  Frozenset  Dict  None Copyright 2020 @SquadInfotech, All rights reserved.
  • 13.  Function for type casting  int()  float()  complex()  bool()  str() Copyright 2020 @SquadInfotech, All rights reserved.
  • 14. Copyright 2020 @SquadInfotech, All rights reserved. • Arithmetic operators • Assignment operators • Comparison operators • Logical operators • Identity operators • Membership operators • Bitwise operators
  • 15.  + Addition (x + y)  - Subtraction (x – y)  * Multiplication (x * y)  / Division (x / y)  % Modulus (x % y)  ** Exponentiation (x ** y)  // Floor division (x // y) Copyright 2020 @SquadInfotech, All rights reserved.
  • 16. Copyright 2020 @SquadInfotech, All rights reserved.  = x = 5 (x = 5)  += x+=5 (x = x + 5)  -= x -= 5 (x = x – 5)  *= x *= 5 (x = x * 5)  /= x /= 5 (x = x / 5)  %= x %= 5 (x = x % 5)  //= x //= 5 (x = x // 5)  **= x **= 5 (x = x ** 5)  &= (x &= 5) (x = x & 5)  |= x |= 5 (x = x | 5) ^= x ^= 5 (x = x ^ 5)
  • 17.  > (Greater than)  < (Lesser than)  == (Equal to )  != (Not equal to)  >= (Greater than or equal to)  <= (Less than or equal to) Copyright 2020 @SquadInfotech, All rights reserved.
  • 18. and := if both values are true then only result is true Or:=True if either of the operands is true Not:= complement Copyright 2020 @SquadInfotech, All rights reserved.
  • 19.  & Bitwise AND  |Bitwise OR  ~Bitwise NO  ^Bitwise XOR  >>Bitwise right shift  <<Bitwise left shift Copyright 2020 @SquadInfotech, All rights reserved.
  • 20.  are used to test whether a value or variable is found in a sequence (string, list, tuple, set and dictionary).  In:=True if value/variable is found in the sequence  Not in:=True if value/variable is not found in the sequence Copyright 2020 @SquadInfotech, All rights reserved.
  • 21.  They are used to check if two values (or variables) are located on the same part of the memory. Two variables that are equal does not imply that they are identical.  is :=True if the operands are identical (refer to the same object)  is not := True if the operands are not identical (do not refer to the same object) Copyright 2020 @SquadInfotech, All rights reserved.
  • 22. Copyright 2020 @SquadInfotech, All rights reserved.
  • 24. Syntax Example (Odd Even) Syntax: if condition: #code else: #code num= int(input("Enter the number to check: ")) if num%2 is 0: print("even number") else: print("odd number") Copyright 2020 @SquadInfotech, All rights reserved.
  • 25. Syntax Example if condition: #code if condition: #code else: #code else: #code per=int(input("Enter your percentage: ")) if per >= 60: exp= int(input("Enter the number of experience: ")) if exp >= 2: print("eligible for job") else: print("not eligible for job") else: print("not qualified“) Copyright 2020 @SquadInfotech, All rights reserved.
  • 26. Syntax Example if condition: #code elif condition: #code elif condition: #code else: #code per= int(input("Enter your percentage: “)) if per >= 90: print("A grade") elif per >=70 and per<90: print("B grade") elif per >=50 and per<70: print(“C grade") else: print(“Be positive, Work hard") Copyright 2020 @SquadInfotech, All rights reserved.
  • 27. Syntax Example while (condition): #code num=int(input(“Enter a number: ")) counter=1 print(“Below are even numbers: ”) while counter<=num: if counter%2==0: print(counter) counter+=1 Copyright 2020 @SquadInfotech, All rights reserved.
  • 28. Syntax Example for counter in range (lower limit, upper limit, [increment factor]): #code for i in range(1,5): # default increment is1 print(i) for i in range(5,0,-1): #decrementing by -1 print(i, end=“ ”) Copyright 2020 @SquadInfotech, All rights reserved.
  • 29. Copyright 2020 @SquadInfotech, All rights reserved.
  • 30.  Strings are arrays of bytes representing Unicode characters.  Python does not have a character data type.  A single character is simply a string with a length of 1.  Square brackets can be used to access elements of the string.  Strings can be created using single, double or even triple quotes. Copyright 2020 @SquadInfotech, All rights reserved.
  • 32.  String in single quotes cannot hold any other single quoted character in it because the compiler won’t recognize where to start and end the string.  To overcome this error, double quotes is preferred, because it helps in creation of Strings with single quotes in them.  For strings which contain Double quoted words in them, use of triple quotes is suggested. Along with this, triple quotes also allow the creation of multiline strings. Copyright 2020 @SquadInfotech, All rights reserved.
  • 33. Single Quote Double Quoted string has a Single Quote # Creation of String # with single Quotes str1 = 'Welcome to the Coder Technologies‘ print(str1) # Creating a String # with double Quotes str2 = "I'm learning python“ print(str2) Copyright 2020 @SquadInfotech, All rights reserved.
  • 34. Triple Quotes Multiline with Triple quotes # Creating a String # with triple Quotes str3 = ‘’’I'm learning python and I’m lovin’ it’’’ print(str3) # Creating multiline # strings str4 = '''hi how are you? This lockdown is so boring! ''' print(str4) Copyright 2020 @SquadInfotech, All rights reserved.
  • 35.  Access characters within a string  Concatenating  Iterating  Formatting  Built-in string methods Copyright 2020 @SquadInfotech, All rights reserved.
  • 36. Copyright 2020 @SquadInfotech, All rights reserved.
  • 37. There are four collection data types:  List: Ordered and changeable. Allows duplicate members.  Tuple: Ordered and unchangeable. Allows duplicate members.  Set: Unordered and un-indexed. No duplicate members.  Dictionary: Unordered, changeable and indexed. No duplicate members. Copyright 2020 @SquadInfotech, All rights reserved.