1 Python Introduction 1.1 What is PythonPython is an object-oriented, interpreted computer programming language, invented by Dutchman Guido van Rossum (Guido van Rossum) in 1989, and the first public offering was released in 1991. The latest version
Python built-in functions (52) -- range, python built-in 52 range
English document:
range(
Stop)
range(
Start,
Stop[,
Step])
Rather than being a function,
rangeIs actually an immutable sequence type, as specified ented
In your opinion, Python Daniel should have this book
In the latest topic, 80% of readers think that Python is the best programming language. There are many similar issues, such as how to get started with Python? How to get started with Python in
Range (1,5) defines integers starting from 1 to 4 [1,2,3,4]Scenario 1:Numbers = range (1,5)For num in numbers:Print (num)Results12345Scenario 2:Numbers = range (1,5)Print (Numbers)ResultsRange (1, 5)"Feel" feel Python's print () function cannot
The following are the details of the "collation":
The
First looks at the following example: >>> x=xrange (0,8) >>> print x Xrange (8) >>> print x[0] 0 >>> print x[7] 7 > >> print x[8] Traceback (most recent call last)
Zope created using the Python language is the most widely used and understandable content management framework in the Python enterprise application field. This intentionally forces programmers to develop good programming habits, one of the most
Example Analysis of range () function usage in python development, pythonrange
This article describes the usage of the range () function in python development. We will share this with you for your reference. The details are as follows:
The range ()
Whether range () or xrange () is a built-in function in Python. The two built-in functions are most commonly used in the For loop. Range () and xrange () are two different implementations in Python 2.
But in Python 3, the implementation of range ()
This function is an array that produces a series of sequences, returning an iteration. The parameter Stop is the number that terminates, and The parameter start is the starting value of the start sequence, and the parameter step is the difference
This example describes the use of the range () function in Python development. Share to everyone for your reference, as follows:
The range () function in Python is very powerful, so I think it is necessary to share with you
As described in its API:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.