Professional Documents
Culture Documents
SU©2020
Introduction
variable is name given to memory area to store value.
It means that when you create a variable, you name space
in the memory.
You can assigning different data types to the variables
you can store integers or characters in these variables.
SU©2020
Assigning Values to Variables
SU©2020
Multiple Assignment
SU©2020
Multiple Assignment…
SU©2020
Standard Data Types
The data stored in variables can be one of many types.
For example, a person's age is stored as a numeric value
and his or her address is stored as alphanumeric characters.
Python has various standard data types.
SU©2020
Standard Data Types…
String
List
SU©2020
Python Numbers
SU©2020
Python Numbers…
SU©2020
Python Numbers…
Examples: Here are some examples of numbers
SU©2020
Python Numbers...
A complex number consists of an ordered pair of real
numbers and the imaginary unit.
• 3.14j
SU©2020
Python Strings
For example:
Str="welcome to Python“
b = 'Hello World!'
SU©2020
Python Lists
List is variable that can hold items of the same data-type or
different data-type.
A list contains items separated by commas and enclosed
within square brackets ([]).
To some extent, lists are similar to arrays in C.
One of the differences between them is that all the items
belonging to a list can be of different data type.
SU©2020
Python Lists
The values stored in a list can be accessed using the slice
operator ([ ] and [:]) with indexes starting at 0 in the
beginning of the list.
The plus (+) sign is the list concatenation operator, and the
asterisk (*) is the repetition operator.
SU©2020
Python Lists
For example:
SU©2020
Some Question…
Python supports three different numerical data types list
them?
Declare (create) integer data type variable
SU©2020
Have nice day
SU©2020