Python Basic Notes (int, float, str & Shortcut Keys)
1. int (Integer)
• Used to store whole numbers (no decimal).
• Examples: 10, -5, 0, 100
• Example code: x = 5
• Type check: type(x)
• Convert to int: int(3.5) → 3
2. float (Decimal Number)
• Used to store decimal numbers.
• Examples: 3.14, -2.5, 0.0
• Example code: y = 3.5
• Type check: type(y)
• Convert to float: float(5) → 5.0
3. str (String)
• Used to store text (characters).
• Written inside quotes (' ' or " ").
• Examples: 'Hello', "Python"
• Example code: name = 'Imran'
• Convert to string: str(10) → '10'
4. Basic Python Shortcut Keys (VS Code / IDLE)
• Ctrl + C → Copy
• Ctrl + V → Paste
• Ctrl + X → Cut
• Ctrl + Z → Undo
• Ctrl + Y → Redo
• Ctrl + S → Save file
• Ctrl + / → Comment or Uncomment line
• Shift + Enter → Run selected code (IDLE)
• F5 → Run program (IDLE)