• Skip to primary navigation
  • Skip to content
  • Skip to footer
Fundamentals of Computing Course Notes Fundamentals of Computing Course Notes UMD Summer II ENAE202
  • General
  • MATLAB
  • Python
  • C++
  • About
    • Home
    • Getting Started
    • User Interface
    • Week 1
      • Variables & Output
      • Input & Data Types
      • Using Libraries
      • Conditionals
      • For Loops
      • While Loops
    • Week 2
      • User-Defined Functions
      • Lists & Tuples
      • List Comprehensions
      • NumPy Arrays
      • Plotting with Matplotlib
      • File Input/Output
    • Week 3
      • Dictionaries
      • Lists of Dictionaries
      • Classes & Objects
      • Class Variables, Methods & Objects
      • Type Hints & Dataclasses
    • List of Examples
    • Sandbox Pages

    For Loop: Powers of Two

    for p in range(11):
        x = 2**p
        print(x)
    
    
    1
    2
    4
    8
    16
    32
    64
    128
    256
    512
    1024
    
    
    • Canvas
    • GitHub
    © 2026 Kenneth (Kip) Hart.