🎓 All Courses | 📚 Python Programming Syllabus

📋 Study this course on TaskLoco
⚡ Key Concept #python-programming#variables#data-types

Variables & Data Types

Python is dynamically typed — you don't declare types, Python infers them.


Basic types:

name = "Alice"        # str
age = 30              # int
height = 5.9          # float
is_student = True     # bool
nothing = None        # NoneType

Check the type:

type(age)    # <class 'int'>

Type conversion:

int("42")      # 42
str(100)       # "100"
float("3.14") # 3.14
bool(0)        # False

Naming rules: lowercase_with_underscores (snake_case). No spaces. Can't start with a number. Case-sensitive.


Constants: By convention, use ALL_CAPS: MAX_SIZE = 100. Python doesn't enforce immutability, it's just a signal.


YouTube • Top 10
Python Programming: Variables & Data Types
Tap to Watch ›
📸
Google Images • Top 10
Python Programming: Variables & Data Types
Tap to View ›

Reference:

Wikipedia: Python

image for linkhttps://en.wikipedia.org/wiki/Python_(programming_language)

📚 Python Programming — Full Course Syllabus
📋 Study this course on TaskLoco

TaskLoco™ — The Sticky Note GOAT