Python Data Types - int, float, Boolean, string, and list TRB CSI › Python Programming › Data types (int, float, Boolean, string, and list),

Python Data Types - int, float, Boolean, string, and list

Data Type என்பது ஒரு variable எந்த வகையான value-ஐ store செய்கிறது என்பதை Python-க்கு தெரிவிக்கும் classification. Simple definition: ஒரு data என்ன type என்பதை காட்டுவது Data Type.

Free Beginner 26 min 196 cards 31 programs 16 MCQs v2
Definition
Meaning

Data Type என்பது ஒரு variable எந்த வகையான value-ஐ store செய்கிறது என்பதை Python-க்கு தெரிவிக்கும் classification.

ஒரு data என்ன type என்பதை காட்டுவது Data Type.

Program
Example
Python 1 lines
1x = 10
Explanation

இங்கு 10 ஒரு integer value.

அதனால்

x → int data type.

Another example

name = "Python"

இங்கு "Python" text.

அதனால்

name → str data type.

இந்த topic-ல் நாம் பார்க்கும் முக்கிய Python data types

int

float

bool

str

list

Simple Explanation
Core idea

ஒரு வீட்டில் different containers இருப்பது போல நினைத்துக் கொள்ளுங்கள்.

Detail 01

Rice வைக்க ஒரு container.

Detail 02

Water வைக்க ஒரு bottle.

Detail 03

Books வைக்க ஒரு shelf.

Detail 04

அதே மாதிரி programming-ல் different kinds of values இருக்கும்.

Program
Example
Python 1 lines
1age = 25
Explanation
Core idea

25 → whole number.

அதனால்

int

Program
Python 1 lines
1price = 99.50
Explanation
Core idea

99.50 → decimal number.

அதனால்

float

Program
Python 1 lines
1passed = True
Explanation
Core idea

True → logical value.

அதனால்

bool

Detail 02

name = "Arun"

Detail 03

"Arun" → text.

அதனால்

str

Detail 05

marks = [80, 90, 75]

Detail 06

Multiple values collection.

அதனால்

list

Detail 08

Simple Memory

Detail 09

int → முழு எண்

Detail 10

float → decimal number

Detail 11

bool → True / False

Detail 12

str → Text

Detail 13

list → Multiple values

Flow
  1. Value கொடுக்கிறோம்
  2. Python அந்த value-ஐ பார்க்கிறது
  3. அதற்கான Data Type determine செய்கிறது
  4. Variable அந்த value-ஐ reference செய்கிறது
  5. Program அதை process செய்கிறது
Program
Example
Python 1 lines
1x = 100
Explanation
Core idea

Five Data Types Flow

Flow
  1. 100
  2. Whole Number
  3. Integer
  4. int
  5. x stores/references the value
Detail 02
  1. Whole Number
  2. int
Detail 03
  1. Decimal Number
  2. float
Detail 04
  1. True / False
  2. bool
Detail 05
  1. Text
  2. str
Detail 06
  1. Collection of Values
  2. list
Syntax
Python 2 lines
1Integer
2variable = integer_value
Program
Example
Python 3 lines
1age = 25
2Float
3variable = decimal_value
Program
Example
Python 3 lines
1price = 45.75
2Boolean
3variable = True
Explanation
Core idea

or

Program
Python 1 lines
1variable = False
Program
Example
Python 3 lines
1is_active = True
2String
3variable = "text"
Explanation
Example
Core idea

name = "Python"

String single quotes-லும் எழுதலாம்

name = 'Python'
List
variable = [value1, value2, value3]

Detail 02

marks = [80, 90, 75]

Program
Program 1
Python 2 lines
1Integer
2age = 25
Program
Python 2 lines
1print(age)
2print(type(age))
Verified output
25
<class 'int'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
25
<class 'int'>
Line by Line
1
age = 25
age என்ற variable-க்கு 25 assign செய்கிறோம். 25 ஒரு whole number. அதனால் அதன் data type: int
2
print(age)
age variable-ல் இருக்கும் value display செய்கிறது. Output: 25
3
print(type(age))
type() function ஒரு value அல்லது variable எந்த data type என்பதை கண்டுபிடிக்க பயன்படுத்தப்படுகிறது. Output: <class 'int'>
Dry Run
Execution traceRead top to bottom · highlighted cells show the current value3 states
StepStatementValueData TypeOutput
01Iteration 1age = 2525int-
02Iteration 2print(age)25int25
03Iteration 3type(age)25int<class 'int'>
Important
  1. int என்பது decimal point இல்லாத whole numbers-க்கு பயன்படுத்தப்படுகிறது.

  2. Examples

    10

  3. -10

  4. 0

  5. 500

  6. -999

  7. இவை எல்லாம்

    int

Common Mistake

10.0 ஒரு integer.

இல்லை.

x = 10.0

float

because decimal point இருக்கிறது.

Memory Trick

INT = Integer = முழு எண்

Decimal point இல்லை → int

TRB Point
  1. Python integer data type is represented by int.

  2. Examples

    10

  3. 0

  4. -25

  5. 500

Interview Point
Question

What is an integer in Python?

Answer

An integer is a whole number without a decimal point. Python represents integer values using the int data type.

MCQ
31What is the data type of: x = 100
Choose one answer

Integer என்பது whole numbers store செய்ய பயன்படும் data type.

10
20
0
-50
1000
Program
Python 1 lines
1x = 100

x = -100

Program
Python 1 lines
1x = 0
Verified output
All are int.
Learning Run Mode — this is the output the author verified, not a live execution.
Output
All are int.
Program
Python 3 lines
1Integer Arithmetic
2a = 10
3b = 5
Program
Python 3 lines
1print(a + b)
2print(a - b)
3print(a * b)
Verified output
15
5
50
Integer Check
x = 50
Learning Run Mode — this is the output the author verified, not a live execution.
Output
15
5
50
Integer Check
x = 50
Program
Python 1 lines
1print(type(x))
Verified output
<class 'int'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
<class 'int'>

Definition
Meaning

Float என்பது decimal point கொண்ட numeric values store செய்ய பயன்படும் Python data type.

10.5
3.14
99.99
-7.5
0.0
Simple Explanation
Whole number

10

→ int

Decimal number

10.5

→ float

Simple

Point இருந்தால் பொதுவாக float என்று நினைவில் வைத்துக்கொள்ளலாம்.

Flow
  1. Decimal Value
  2. Python identifies decimal point
  3. Floating-point number
  4. float
Program
Example
Python 1 lines
1price = 99.50
Explanation
Core idea
  1. 99.50
  2. Decimal number
  3. float
Syntax
Python 1 lines
1variable = decimal_value
Program
Example
Python 1 lines
1height = 5.8
Program
Python 1 lines
1price = 99.50
Program
Python 2 lines
1print(price)
2print(type(price))
Verified output
99.5
<class 'float'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
99.5
<class 'float'>
Line by Line
1
price = 99.50
price variable-க்கு decimal value assign செய்கிறோம். அதனால்: price → float
2
print(price)
Output:
3
print(type(price))
Output:
Dry Run
Execution traceRead top to bottom · highlighted cells show the current value3 states
StepStatementValueTypeOutput
01Iteration 1price = 99.5099.5float-
02Iteration 2print(price)99.5float99.5
03Iteration 3type(price)99.5float<class 'float'>
Important
  1. இந்த value

    10

  2. → int

  3. இந்த value

    10.0

  4. → float

  5. Value mathematically same போல இருந்தாலும் Python data type different.

Common Mistake
Context

x = 5.

float

because decimal notation பயன்படுத்தப்பட்டுள்ளது.

print(type(5.0))

Output
<class 'float'>
Memory Trick

FLOAT = Floating decimal point

Decimal point → float

TRB Point

Python floating-point numbers are represented using the float data type.

Interview Point
Question

What is the difference between int and float?

Answer

int stores whole numbers without a decimal point. float stores floating-point or decimal numbers.

MCQ
63What is the type of: x = 25.0
Choose one answer

Definition
Meaning

Boolean என்பது True அல்லது False என்ற இரண்டு logical values-ஐ represent செய்யும் data type.

bool

  • True
  • False
Simple Explanation
Core idea

Boolean-ஐ ஒரு Yes / No switch போல நினைக்கலாம்.

Detail 01

Yes → True

Detail 02

No → False

Program
Example
Python 1 lines
1is_student = True
Verified output
True
Learning Run Mode — this is the output the author verified, not a live execution.
Definition
Meaning
Meaning

Student ஆ? → Yes.

Key termis_absent = False
Definition
Meaning
Meaning

Absent ஆ? → No.

Flow
  1. Condition check
  2. Condition correct என்றால்
  3. True
  1. Condition wrong என்றால்
  2. False
Explanation
Example
Core idea

10 > 5

Detail 01

10 greater than 5.

Detail 02

Yes.

Output
Result
True
Syntax
Python 1 lines
1variable = True
Explanation
Core idea

or

Syntax
Python 1 lines
1variable = False
Important
  1. Correct

    True

  2. False

  3. Wrong

    true

  4. false

  5. Python case-sensitive.

Program
Python 1 lines
1passed = True
Program
Python 2 lines
1print(passed)
2print(type(passed))
Verified output
True
<class 'bool'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
True
<class 'bool'>
Line by Line
1
passed = True
passed variable-க்கு Boolean value True assign செய்யப்படுகிறது.
2
print(passed)
Output:
3
print(type(passed))
Output:
Dry Run
Execution traceRead top to bottom · highlighted cells show the current value3 states
StepExpressionMeaningResult
01Iteration 110 > 5Is 10 greater than 5?True
02Iteration 210 < 5Is 10 less than 5?False
03Iteration 310 == 10Are both equal?True
Important
  1. Boolean values

    True

  2. False

  3. Capital T and capital F முக்கியம்.

  4. Correct

    x = True

  5. Wrong

    x = true

  6. Wrong code gives

    NameError

  7. because Python true என்பதை variable name போல எடுத்துக்கொள்ளும்.

Common Mistake
  • TRUE
  • FALSE
  • true
  • false
  • True
  • False
Memory Trick

BOOL = Boolean = Two values

True / False

TRB Point

The Boolean data type in Python has two values: True and False.

Interview Point
Question

What is Boolean data type in Python?

Answer

The Boolean data type represents logical values. Python uses True and False, and its type name is bool.

MCQ
87Which is a valid Python Boolean value?
Choose one answer

Definition
Meaning

String என்பது characters அல்லது text-ஐ represent செய்யும் sequence data type.

str

Explanation
Example
Core idea

name = "Python"

Simple Explanation
Core idea

Letters, words, sentences, numbers-as-text போன்றவற்றை quotes உள்ளே எழுதினால் அது string.

Explanation
Example
Core idea

"Hello"

Detail 01

→ String

Detail 02

"Python Programming"

Detail 03

→ String

Detail 04

"123"

Detail 05

→ இதுவும் String.

Detail 06

ஏன்?

Detail 07

123 quotes உள்ளே இருக்கிறது.

Flow
  1. Characters
  2. Quotes உள்ளே எழுதுகிறோம்
  3. Python அதை text என்று எடுத்துக்கொள்கிறது
  4. str
Explanation
Example
Core idea

"369 Tesla"

Detail 01
  1. Text
  2. String
  3. str
Double quotes

variable = "text"

Single quotes

variable = 'text'

Detail 04

name = "Python"

Detail 05

or

Detail 06

name = 'Python'

Detail 07

இரண்டும் valid.

Detail 08

name = "Python"

Program
Python 2 lines
1print(name)
2print(type(name))
Verified output
Python
<class 'str'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
Python
<class 'str'>
Line by Line
1
name = "Python"
name variable-க்கு "Python" text assign செய்கிறோம். Quotes உள்ளதால் Python அதை string-ஆக எடுத்துக்கொள்கிறது.
2
print(name)
Output:
3
print(type(name))
Output:
Table
CharacterPython
Index012345
Explanation
Core idea

print(word[0])

Program

word = "Python"

Output

P
Negative Index
word = "Python"

Detail 03

print(word[-1])

Output

n

Detail 05

-1 → last character.

Detail 06

String Concatenation
first = "Hello"
second = "Python"

Detail 07

print(first + " " + second)

Output

Hello Python

Detail 09

- strings-ல் concatenation செய்யும்.

Detail 10

String Repetition
print("Hi " * 3)

Output

Hi Hi Hi
Length of String
name = "Python"

Detail 12

print(len(name))

Output

6

Program
Python 2 lines
1name = "Python"
2print(name[0])
Verified output
<class 'int'>
<class 'str'>
Learning Run Mode — this is the output the author verified, not a live execution.
Dry Run
Execution traceRead top to bottom · highlighted cells show the current value3 states
StepStatementValueOutput
01Iteration 1name = "Python"Python-
02Iteration 2name[0]First characterP
03Iteration 3print()PP
Important
  1. Quotes difference

    123

  2. → int

  3. But

    "123"

  4. → str

  5. Check

    print(type(123))

  6. print(type("123"))

Output
<class 'int'>
<class 'str'>
Common Mistake

name = Python

Python இதை text என்று எடுத்துக்கொள்ளாது.

Python என்ற variable இருக்கிறதா என்று பார்க்கும்.

NameError

name = "Python"

Memory Trick

STR = String = Text

Quotes உள்ளே → String.

TRB Point

Strings in Python are sequences of characters enclosed within quotes and are represented by the str type.

Interview Point
Question

What is a string in Python?

Answer

A string is a sequence of characters used to represent text. Python strings can be written using single or double quotation marks.

MCQ
108What is the data type of: x = "100"
Choose one answer

Definition
Meaning

List என்பது multiple values-ஐ ஒரே variable-ல் ordered collection ஆக store செய்யும் Python data type.

[]

Explanation
Example
Core idea

marks = [80, 90, 70]

Simple Explanation
Core idea

ஒரு student-க்கு 5 marks இருக்கிறது என்று வைத்துக்கொள்வோம்.

Separate variables
m1 = 80
m2 = 90
m3 = 70
m4 = 85
m5 = 95
இப்படி எழுதுவதற்குப் பதிலாக

marks = [80, 90, 70, 85, 95]

Detail 03

ஒரே variable-ல் multiple values store செய்யலாம்.

Detail 04

இதுதான் list.

Flow
  1. Multiple Values
  2. Square Brackets [ ]
  3. Comma-separated items
  4. Ordered Collection
  5. list
Explanation
Example
Core idea

[10, 20, 30]

Detail 01
  1. Multiple values
  2. List
Detail 02

list_name = [item1, item2, item3]

Detail 03

numbers = [10, 20, 30]

Strings list

languages = ["Python", "Java", "C"]

Mixed list

data = [10, 5.5, "Python", True]

Detail 06

Python list different data types-ஐ contain செய்ய முடியும்.

Detail 07

numbers = [10, 20, 30]

Program
Python 2 lines
1print(numbers)
2print(type(numbers))
Verified output
[10, 20, 30]
<class 'list'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
[10, 20, 30]
<class 'list'>
Line by Line
1
numbers = [10, 20, 30]
numbers என்ற variable-ல் 3 integer values list ஆக store செய்யப்பட்டுள்ளன.
2
print(numbers)
Output:
3
print(type(numbers))
Output:
Table
Value102030
Index012
Explanation
Core idea

List is mutable.

Program

print(numbers[0])

Output

10
Second Element
print(numbers[1])

Output

20
Last Element
print(numbers[-1])

Output

30
Change a List Value

Detail 05

Mutable என்றால் value-ஐ change செய்யலாம்.

Example

numbers = [10, 20, 30]

Detail 07

numbers[1] = 200

Detail 08

print(numbers)

Output

[10, 200, 30]
Add Element - append()
numbers = [10, 20, 30]

Detail 10

numbers.append(40)

Detail 11

print(numbers)

Output

[10, 20, 30, 40]
Remove Element
numbers = [10, 20, 30]

Detail 13

numbers.remove(20)

Detail 14

print(numbers)

Output

[10, 30]
List Length
numbers = [10, 20, 30, 40]

Detail 16

print(len(numbers))

Output

4

Program
Python 3 lines
1numbers = [10, 20, 30]
2numbers.append(40)
3print(numbers)
Dry Run
Execution traceRead top to bottom · highlighted cells show the current value3 states
StepStatementList ValueOutput
01Iteration 1Create list[10,20,30]-
02Iteration 2append(40)[10,20,30,40]-
03Iteration 3print(numbers)[10,20,30,40][10,20,30,40]
Important
  1. List properties

    Ordered

  2. Indexed

  3. Mutable

  4. Allows duplicate values

  5. Can contain different data types

Explanation
Example
Core idea

data = [10, 10, "Python", 5.5, True]

Detail 01

Valid list.

Common Mistake

[]

x = [10, 20, 30]

(10, 20, 30)

This is a tuple, not a list.

Memory Trick

LIST = List of many values

[] → List.

TRB Point

A Python list is an ordered and mutable collection represented using square brackets.

Interview Point
Question

What is a list in Python?

Answer

A list is an ordered, mutable collection of values. It is represented using square brackets and can contain duplicate as well as mixed data types.

Comparison
int vs float vs bool vs str vs list
Data TypeMeaningExampleSymbol / Form
intWhole number10Number
floatDecimal number10.5Decimal
boolLogical valueTrueTrue/False
strText"Python"Quotes
listMultiple values[10,20][ ]
Comparison
More Detailed Comparison
Pointintfloatboolstrlist
Example1010.5True"Hi"[10,20]
Numeric?YesYesLogicalNoCollection
Quotes needed?NoNoNoYesDepends on items
Multiple values?NoNoNoCharactersYes
Indexed?NoNoNoYesYes
Mutable?Not in-placeNot in-placeNot in-placeNoYes
Important
  1. Python Automatically Determines Data Type

  2. Python-ல் usually variable declaration-ல் type எழுத வேண்டியதில்லை.

  3. C/C++ style

    int x = 10;

  4. Python

    x = 10

  5. Python automatically

  6. 10 பார்த்து

    int

  7. என்று determine செய்கிறது.

  8. இதனை dynamic typing உடன் தொடர்புபடுத்தலாம்.

Important
  1. type() Function

  2. Data type check செய்ய

    type(value)

Program
Example
Python 2 lines
1x = 10
2print(type(x))
Verified output
<class 'int'>
All Types Example
a = 10
b = 10.5
c = True
d = "Python"
e = [10, 20, 30]
Learning Run Mode — this is the output the author verified, not a live execution.
Output
<class 'int'>
All Types Example
a = 10
b = 10.5
c = True
d = "Python"
e = [10, 20, 30]
Program
Python 5 lines
1print(type(a))
2print(type(b))
3print(type(c))
4print(type(d))
5print(type(e))
Verified output
<class 'int'>
<class 'float'>
<class 'bool'>
<class 'str'>
<class 'list'>
Learning Run Mode — this is the output the author verified, not a live execution.
Output
<class 'int'>
<class 'float'>
<class 'bool'>
<class 'str'>
<class 'list'>
Explanation
Core idea

a = 10

Detail 01

10 whole number.

Detail 02

Type → int.

Detail 03

b = 10.5

Detail 04

Decimal value.

Detail 05

Type → float.

Detail 06

c = True

Detail 07

Logical value.

Detail 08

Type → bool.

Detail 09

d = "Python"

Detail 10

Text inside quotes.

Detail 11

Type → str.

Detail 12

e = [10, 20, 30]

Detail 13

Multiple values inside square brackets.

Detail 14

Type → list.

Dry Run
Execution traceRead top to bottom · highlighted cells show the current value5 states
TraceVariableValuePython identifies as
01a10int
02b10.5float
03cTruebool
04d"Python"str
05e[10,20,30]list
Common Mistake
Error 1

10 and "10" same என்று நினைப்பது
10 → int

"10" → str

Completely different types.

Common Mistake
Error 2

True quotes உள்ளே எழுதுவது
x = True → bool

But:

x = "True" → str

Common Mistake
Error 3

List brackets confuse செய்வது
[1, 2, 3] → list

"1, 2, 3" → string

Common Mistake
Error 4
Context

bool value lowercase

x = false

x = False

Common Mistake
Error 5

Float-ஐ int என்று நினைப்பது
x = 10.0

Type:

float

Memory Trick
  • I → Integer
  • F → Float
  • B → Boolean
  • S → String
  • L → List
  • Integer Float Boolean String List
  • Visual Memory
  • 10 → int
  • 10.5 → float
  • True → bool
  • "10" → str
  • [10] → list
  • 10
  • 10.0
  • True
  • "10"
  • [10]
  • int
  • float
  • bool
  • str
  • list
TRB Point
TRB Point 1

int represents whole numbers.

TRB Point
TRB Point 2

float represents floating-point numbers.

TRB Point
TRB Point 3
  1. Boolean values are

    True

  2. False

TRB Point
TRB Point 4

Python Boolean type is:

bool

TRB Point
TRB Point 5

String type is:

str

TRB Point
TRB Point 6

Strings are enclosed in quotes.

TRB Point
TRB Point 7
  1. Lists use

    [ ]

  2. square brackets.

TRB Point
TRB Point 8

List is mutable.

TRB Point
TRB Point 9

String is immutable.

TRB Point
TRB Point 10

Python type() function identifies the type of an object.

TRB Point
TRB Point 11
  1. 10

  2. is int.

TRB Point
TRB Point 12
  1. 10.0

  2. is float.

TRB Point
TRB Point 13
  1. "10"

  2. is str.

TRB Point
TRB Point 14
  1. [10]

  2. is list.

TRB Point
TRB Point 15

Python is dynamically typed; explicit variable type declaration is generally not required.

Interview Point
Question 1

What is a data type?

Answer

A data type identifies what kind of value an object represents and what operations are appropriate for it. Examples include integer, float, Boolean, string and list.

Interview Point
Question 2

How do you find a variable's type in Python?

Answer

The built-in type() function is used.

Program
Example
Python 2 lines
1x = 10
2print(type(x))
Interview Point
Question 3

What is the difference between 10 and "10"?

Answer

10 is an integer, while "10" is a string because it is enclosed in quotation marks.

Interview Point
Question 4

What is the difference between a string and a list?

Answer

A string is an immutable sequence of characters. A list is a mutable ordered collection that can contain multiple values and different data types.

Interview Point
Question 5

Can a Python list contain different data types?

Answer

Yes.

Explanation
Example
Core idea

data = [10, "Python", 5.5, True]

MCQ
166What is the type of: x = -50
Choose one answer
MCQ
167What is the type of: x = 5.0
Choose one answer
MCQ
168Which one is Boolean?
Choose one answer
MCQ
169What is the type of: x = "Python"
Choose one answer
MCQ
170Which symbol is used to create a list?
Choose one answer
MCQ
171What is the output? x = [10, 20, 30] print(x[0])
Choose one answer
MCQ
172What is the output? x = "Python" print(x[1])
Choose one answer
MCQ
173What is the type of: x = "100"
Choose one answer
MCQ
174What is the type of: x = [100]
Choose one answer
MCQ
175Which is mutable?
Choose one answer
MCQ
176What is the output? print(type(False))
Choose one answer
MCQ
177What is the output? x = [10, 20] x.append(30) print(x)
Choose one answer
Practice
Practice 1

Identify the data types:

a = 100
b = 9.5
c = False
d = "Computer"
e = [1, 2, 3]

Answer:

a
int
b
float
c
bool
d
str
e
list
Practice
Practice 2

Use type() and check:

x = 500

Practice
Practice 3

Create a float variable called salary.

Program
Example
Python 1 lines
1salary = 25000.50
Verified output
200
Learning Run Mode — this is the output the author verified, not a live execution.
Practice
Practice 4

Create a Boolean variable:

is_passed = True

Practice
Practice 5

Create a string containing your name.

name = "Your Name"

Practice
Practice 6

Create a list containing 5 marks.

marks = [80, 90, 75, 85, 95]

Practice
Practice 7

Print the second element:

numbers = [100, 200, 300]

Answer:

print(numbers[1])

Output
200
Practice
Practice 8

Find the output:

x = "10"
y = "20"

print(x + y)
Output
1020

Reason:

Both are strings.

List
  • performs concatenation.
Practice
Practice 9

Find the output:

x = 10
y = 20

print(x + y)
Output
30

Reason:

Both are integers.

Practice
Practice 10

Find the difference:

x = True
y = "True"

Answer:

x
bool
y
str
Summary
  1. Data type identifies what kind of valueis stored or represented.
  2. intis used for whole numbers.
  3. floatis used for decimal numbers.
  4. bool represents True and False.
  5. str represents text.
  6. liststores multiple ordered values.
  7. type() identifies an object's datatype.
  8. Stringsuse quotes.
  9. Listsuse square brackets [ ].
  10. List indexingstarts from 0.
  11. Stringsare indexed from 0.
  12. Listsare mutable.
  13. Stringsare immutable.
  14. 10 and "10"are different.
  15. True and "True"are different.
  16. Python generallydetermines types automatically at runtime.
Quick Revision
  1. 10 → int
  2. 10.5 → float
  3. True → bool
  4. "Python" → str
  5. [10, 20] → list
  6. type() → Find data type
  7. [] → List
  8. Quotes → String
  9. True / False → Boolean
  10. Decimal point → Float
  11. Whole number → Integer
  12. List → Ordered + Mutable
  13. String → Sequence of characters +Immutable
  14. Indexstarts at → 0
  15. Python → Dynamically typedlanguage
Text size
17px
Theme
Contents
Print / PDF
Program