python data types notes (rough)
these r just basic notes, not too deep. written to understand not to impress.
numbers
int -> whole numbers. no decimal. like 1, 5, -3. used for counting n all.
float -> decimal numbers. like 2.5, 9.0. used for money n measurements.
complex -> has j in it. barely used tbh. just know it exist.
string (str)
anything inside quotes. "hello", 'elle', "123". numbers in quotes r still text.
boolean
only true or false. used in if else stuff mostly.
list
collection of items. ordered. can change. allows duplicates.
example: fruits = ['apple', 'banana', 'mango']
tuple
same as list but cant change. once made its fixed.
example: coords = (10, 20)
set
stores only unique values. no duplicates allowed. unordered.
example: {1,2,2,3} -> {1,2,3}
types of sets
normal set -> can change it.
empty set -> use set(). {} is not empty set.
frozen set -> cant change. rare use.
dictionary
key value pairs. used to store real data.
example: person = {'name':'elle','age':20}
none
means nothing is assigned. not 0. just nothing.
thats it. enough to understand basics.