Skip to Content
πŸŽ‰ Welcome to my notes πŸŽ‰
Python1. Variables

πŸ«™ Variables

A container for value (String, Intiger, float, boolean, etc).

variables.py
# String name = "John Doe" print(name) print(f"Hello, {name}!") # Formatted string | f-string # Integer age = 30 print(age) # Float height = 5.9 print(height) # Boolean is_student = True print(is_student)

πŸ” Variable Naming Rules:

  • Must begin with a letter (a-z, A-Z) or an underscore ( _ )
  • Can contain letters, numbers, and underscores
  • Case-sensitive: Name and name are different
Last updated on