Variables, Data Types, Operators Flashcards
Learn operators in Python
Variable
A box to store data | Points to a specific location in the memory
Data Type
Type of the container that stores the data
Integer
Whole Number (1, 0, 103, 81)
Float
Decimal Value (5.5, 2.5, 19.0)
Boolean
Yes or No? True or False?
List
A sequence of elements stored continuously, pointed by a single variable ([1,2,3,4,5])
A list can store different data
[‘Gnanambhal’, ‘Shivarraman’, 24, 3.7]
Operators
Tools to perform operations between data
Addition, Subtraction, Multiplication, Division
+ - * /
Floor Division
Rounds the answer to the lowest decimal
5 / 2 = 2.5
5 // 2 = 2
Modulo
Remainder of a division
5 % 2 = 1
5 % 3 = 2
Power
2 ** 3 = 8
Equality
var1 == var2 (Returns True or False)
Non Equality
var1 != var2 (Returns True or False)
Strings
Stores numbers, alphabets and symbols together
‘Pethaa Shivarraman’
‘Password@231’