Python Random Module (Python Random Module क्या है ?)

Random Module In Python

codeinhindi

Random Module and its Functions

नमस्कार दोस्तो आज इस आर्टिकल में जानेंगे कि Python Random Module and its Functions क्या हैं ? और यह कितने प्रकार के होते हैं ?

Python द्वारा random number(s) generate करने के लिए 'random' module का इस्तेमाल किया जाता है 

Random Number को generate करने के लिए कुछ functions होते है | वो निचे दिए गए है |

Important random Functions

Random FunctionDescription
choice()दिए हुए sequence(list, tuple) में से random number return करता है |
randint()दिए हुए beg(inclusive) और end(inclusive) के बीच का random number return करता है |
random()0 और 1 के बीच का random number; floating-point value में return करता है |
randrange()दिए हुए range(beg to end) के बीच का random number return करता है |
sample()दिए हुए sequence और length से random items को list में return किया जाता है |
seed()इसका इस्तेमाल random number generator को initialize कने के लिए किया जाता है |
shuffle()इसका इस्तेमाल sequence(list, tuple) के items की positions को randomly change करने के लिए किया जाता है |
uniform()दिए हुए दो numbers के बीच से floating-point random value return करता है |



अगर आपको यह पोस्ट 📑 (Python Random Module) पसंद आई हो तो अपने मित्रों के साथ जरूर शेयर करें। धन्यवाद !
Maxon

Hello there! I'm Maxon, a dedicated UI/UX designer on a mission to transform digital experiences into intuitive, user-centric journeys. With a keen eye for detail and a passion for crafting aesthetically pleasing interfaces, I strive to create designs that not only look stunning but also enhance usability and functionality.

Post a Comment

Previous Post Next Post