Data Loading...
Introduction of Python-1 Flipbook PDF
Introduction of Python-1
135 Views
75 Downloads
FLIP PDF 1.12MB
Introduction of Python - 1 Marina Hermaningsih
Data Type Integer
Floating Point
Whole numbers
Decimal Numbers
”Characters”
True or False
Class = int Slicing & Indexing are not allowed
Class = float Slicing & Indexing are not allowed
Class = str Allow Slicing & Indexing . Iterable
Class = bool Slicing & Indexing are not allowed
String ““
Boolean
Data Type List [ ]
Class : list
Dictionary {key : value } []
{}
Ordered, mutable, iterable, allow duplicate, indexing, slicing, Tuple ( ) Class : tuple Ordered, immutable, iterable, allow duplicate, indexing, slicing
Class : dict Keys are immutable, iterable Indxing and slicing are not allowed Set { }
()
{}
Class : set Unordered, mutable,iterable duplicate, indexing and slicing are not allowed
Elements of data don’t have a defined order, that order will change after running
Mutable means we can change the elements /items after it has been created Return sequence of items/elements
Insight Unordered
Mutable
Ordered
2023
Slicing
Duplicate
Indexing Iterable
Iterable = Can be iterated by loop method
Elements of data have a defined order, that order will not change after running
Allow duplicate means data can have two items with the same value Positif index starts 0 from left side, while negative index starts-1 from right index
Python Operation Arithmetic
Assignment
Comparison
Mathematical Set
x+y
x += y
x>y
x-y
Union x|y
x -= y
x= y x