Get the App
SLTechnology News&Howtos  ›  Development  › 

How python uses the randint () function

Shulou Source: shulou.com Published: 2022-06-01 02:56:04 11月14日 Update

This article will explain in detail how python uses the randint () function. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Randint () function

Description: the randint () method will randomly generate an integer in the range of [XMagi y]; it is somewhat equivalent to randrange (xQuery 1).

Grammar

Import randomrandom.randint (XBI y)

Parameters:

X-the starting value in the specified range, included in the range

Y-the end value in the specified range, included in the range.

Example demonstration

> > print random.randrange (5d10); 9 > print random.randint (5d10); what are the commonly used libraries of 6python: 1. Requesuts2. Scrapyfie3. Pillowters4. Twistedterrane5. Numpyter6. Matplotlib, 7. Pygama, 8. Ipyhton.

This is the end of the article on "how python uses the randint () function". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Scope function article commonly used more good practical content parameters examples integers articles methods knowledge equivalence grammar reference help related presentation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Shulou Tech Info Shulou Information Microsoft