Loading lesson…
អថេរ & ប្រភេទទិន្នន័យ
Variables are containers that store data. In Python you create a variable simply by assigning a value — no type declaration needed.
name = "Sokha" # str — text age = 22 # int — whole number gpa = 3.75 # float — decimal is_student = True # bool — True or False
Run type(age) and Python will tell you it's <class 'int'>. Very handy for debugging!
strintfloatboolPython is case-sensitive. `name` and `Name` are two different variables. Always use lowercase_with_underscores for variable names.