Dev4Hub
TutorialsRoadmapReviewNotesCode Editor
Sign inSign up
  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL
Your progress0 / 10
search
school

Python Basics

  • 1Python Introduction
  • 2Python Syntax
  • 3Python Variables
alt_route

Python Control Flow

  • 1Python If...Else
  • 2Python While Loops
  • 3Python For Loops
  • 4Python Functions
Tutorialschevron_rightPython Tutorialchevron_rightPython For Loops

Python For Loops

format_list_numberedLesson 10 of 11schedule1 min readview_agenda1 sectionauto_awesomeAI tutor ready
01

The for Loop

A for loop is used for iterating over a sequence (that is either a list, tuple, dictionary, set, or string).

Example

fruits = ["apple", "banana", "cherry"]
for x in fruits:
    print(x)

Output

apple
banana
cherry
Try it Yourself »
arrow_back PreviousPython While LoopsNext arrow_forwardPython Functions

Dev4Hub

Learn coding with hands-on tutorials, examples and quizzes — covering Python, HTML, CSS, JavaScript, SQL and more.

Tutorials

  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL

Tools

  • Code Editor
  • All Tutorials
© 2026 Dev4Hub. Inspired by the W3Schools learning model.