self-driving
  • Introduction
  • Python
    • Set
    • For loop basic
    • Function decorator
    • numpy arrays
    • Kalmen filter
    • Class
    • Python debugger
    • SciPy Library
    • 2D Data Visualization
    • Math in Python
    • Basic Data Visualization
    • Random library
    • List Comprehensions
    • Lists and Loops
    • Interface
  • C++
    • Profiling
    • GCC Compiler Optimization
    • Reference
    • Vector reserve()
    • ifndef
    • Class 2/2
    • Class 1/2
    • C++ Libraries
    • switch
    • Vectors
    • Vector Methods
    • Overload in C++
    • 2D vectors
Powered by GitBook
On this page
  • Python allows you loop over a list
  • If you want to loop until a specified number, use range(number)

Was this helpful?

  1. Python

For loop basic

Python allows you loop over a list

for i in [0,1,2,3,4,5]: print(i)

0
1
2
3
4
5

If you want to loop until a specified number, use range(number)

for i in range(6): print(i)

0
1
2
3
4
5
PreviousSetNextFunction decorator

Last updated 6 years ago

Was this helpful?