Get the App
SLTechnology News&Howtos  ›  Development  › 

How python uses the choice () function

Shulou Source: shulou.com Published: 2022-06-01 02:56:03 10月03日 Update

This article will explain in detail how python uses the choice () 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.

Choice () function

Description: the choice () method returns a list, tuple, or random item of a string.

Grammar

Import randomrandom.choice (x)

Parameters:

X-- a kind of list,tuple,strings

Example demonstration

> print random.choice > print random.choice ([10Lei2 pyrrine]) 85 > print random.choice ('I love python') what are the main application areas of vpython? cloud computing, typical application OpenStack. 2. WEB front-end development, many large websites are developed by Python. 3. Artificial intelligence applications, which are based on big data's analysis and deep learning, have essentially been unable to leave python. 4. System operation and maintenance project, the standard configuration of automatic operation and maintenance is python+Django/flask. 5. Financial management analysis, quantitative transaction, financial analysis. 6. Big data's analysis.

This is the end of the article on "how python uses the choice () 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: Analysis functions articles applications artificial artificial intelligence data data analysis intelligence more finance development good practical typical content front end parameters characters strings Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology MySQL Microsoft vpn