Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. Python Fundamentals

Lesson 8 of 55 · Python

Loops – For

Duration: 20 minutes

Loops – For\n\nPython’s for loop iterates over any iterable – lists, tuples, strings, ranges, or generators. It abstracts away manual indexing.\n\npython\n# Iterate over a list\nfruits = ['apple', 'banana', 'cherry']\nfor fruit in fruits:\n print(fruit)\n\n# Iterate over a range of numbers\nfor i in range(3):\n print('i =', i)\n\n\nIf you need both the index and the value, use enumerate():\npython\nfor idx, fruit in enumerate(fruits, start=1):\n print(idx, fruit)\n\n

Previous: Loops – WhileNext: Functions