Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn For Loop | Control Flow
Introduction to Data Analysis in Python

For Loop

Swipe to show menu

We use loops if we want to repeat any action n-times.

1234
prices = [100, 458, 231, 378] for i in prices: print(i, end = '')
12345
# Decreasing prices by 1 prices = [3, 5, 6, 2, 7, 8] for i in prices: print(i, end = ' ')

end = ' ' means that the result will be written in one row (not column).

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 7

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

For Loop

We use loops if we want to repeat any action n-times.

1234
prices = [100, 458, 231, 378] for i in prices: print(i, end = '')
12345
# Decreasing prices by 1 prices = [3, 5, 6, 2, 7, 8] for i in prices: print(i, end = ' ')

end = ' ' means that the result will be written in one row (not column).

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 7
some-alt