💡 Understand Python

The building blocks of Python programming

📍 Overview 🔍 Observe 💡 Understand ✏️ Practice

Python Basics

1. Variables - Storing Data
name = "Alice" # String (text)
age = 15 # Integer (whole number)
height = 1.65 # Float (decimal)
is_student = True # Boolean (True/False)

Rules:

  • Variable names can contain letters, numbers, underscore
  • Cannot start with a number
  • Case-sensitive: age and Age are different
2. Data Types
TypeExampleDescription
int42, -7, 0Whole numbers
float3.14, -2.5Decimal numbers
str"Hello", 'Python'Text (strings)
boolTrue, FalseBoolean values
3. Operators
OperatorMeaningExample
+Addition5 + 3 = 8
-Subtraction10 - 4 = 6
*Multiplication6 * 7 = 42
/Division15 / 3 = 5.0
//Integer Division17 // 5 = 3
%Modulus (remainder)17 % 5 = 2
**Exponent (power)2 ** 3 = 8
← Back to Observations Continue to Practice →