About Python, for ~ (range)

Note about the range function of the for statement

・ Range (n) is an integer sequence from 0 to n-1. ・ Range (n, m) is an integer sequence from n to m-1 ・ Range (n, m, k) is the tolerance p from n to m-1

for i in range(10):
    print(i)
0
1
2
3
4
5
6
7
8
9

Values from 1 to 9 are assigned to i.

for i in range(4,10):
    print(i) 
4
5
6
7
8
9

Values from 4 to 9 are assigned to i.

for i in range(4,10,2):
    print(i)
4
6
8

Substitute 2 for i with a value from 4 to 9.

Recommended Posts

About Python, for ~ (range)
About "for _ in range ():" in python
About python, range ()
About Python for loops
About Fabric's support for Python 3
2016-10-30 else for Python3> for:
About python slices
About python comprehension
About Python tqdm.
About python yield
About python, class
About python inheritance
About python decorators
About python reference
About Python decorators
[Python] About multi-process
python> link> range () / xrange ()
Summary about Python scraping
About function arguments (python)
Python basics ② for statement
[Python] Memo about functions
Play with Lambda layer (python) for about 5 minutes
Summary about Python3 + OpenCV3
python textbook for beginners
About pgbench for MySQL
About Python3 character code
Refactoring tools for Python
[Python] Memo about errors
About Python development environment
Python: About function arguments
Python, about exception handling
python for android Toolchain
About Python Pyramid traversal
About polymorphism for nesting
About Python3 ... (Ellipsis object)
[Python] Chapter 01-01 About Python (First Python)
[Python] About standard input
About __all__ in python
OpenCV for Python beginners
Install Python (for Windows)
[Python] for statement error
About Python external module import <For super beginners>
Python environment for projects
Write about building a Python environment for writing Qiita Qiita
About creating and modifying custom themes for Python IDLE
python memo (for myself): About the development environment virtualenv
[Python] Find out about pip
Python memo (for myself): Array
Python list, for statement, dictionary
Python for Data Analysis Chapter 4
Modern Python for intermediate users
Learning flow for Python beginners
Python 3.6 installation procedure [for Windows]
About python objects and classes
About Python variables and objects
BigQuery integration for Python users
Python learning plan for AI learning
About the Python module venv
Set Up for Mac (Python)
Think about architecture in python
About python beginner's memorandum function