Python Tutorial: Generate Random Numbers and Data Using the random Module

43
9



In this Python Programming Tutorial, we will be learning how to generate random numbers and choose random data from lists using the random module. I personally use the random module pretty often in my tutorials to generate random data. This can also be used be games, simulations, and plenty of other useful tasks. Let’s get started.

The code from this video can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –

#Python

Nguồn: https://boomercoalition.org

Xem thêm bài viết khác: https://boomercoalition.org/cong-nghe/

43 COMMENTS

  1. Can you explain please what is the role of random.seed() method ?
    I have read the documentation. But didn't find understandable.

  2. im tryna make a program that randomly chooses 1 set of lists and choose something random from that list it chose instead it prints the whole list anybody able to help?

  3. Hey man my Programm just closes after i Start it i was trying to make two Liste with words and thean combining theam and printing theam out ans soulutions?

  4. Thank you so much Corey for making time out to make all these available. You make learning python very smooth. I will definitely follow through all of these contents and practice and practice and practice. Thanks once again

  5. Anyone know how I can use random numbers as coordinates for pygame? so that i can make objects move.

  6. I've been struggling my way through some classes at my community college and your videos have saved my bacon on more than one occasion. Thank you for the clear and concise content. Keep it up!

  7. #. Write a Python program to shuffle and print a specified list.

    lista=[23,3434,535,435,435,43,5,234,2,34,234,2,4,32,432,4,45,454,545,4,5,45,4,54545,45454,545,45,45,32]

    import random

    print(dir(random))

    print(help(random.shuffle))

    aa=random.shuffle(lista)

    print(aa)

    why i cant define my shuffle in a new cariable?

  8. This really really helped me out a lot, thanks so much for this tutorial! I'm a FAN! You rock! 💯💯💯💯

  9. You are my favorite python tutor and I always recommend to people your channel. Because you explain the very easiest and efficient way than spending too much time reading python documentation. Thank you @corey.

  10. I have some problems with the random.choices part. It says "'module' object has no attribute 'choices'". Help T-T

    Edit: nevermind I was using the wrong Python version :/

  11. Hey guys I am new to python right now but I just have a small question. As he said 0:40 dad this module should not be used in security sort of things does that mean if I want to create a random password generator I should not with this module

    !!help!!

  12. I have learned a lot from your video. you are amazing. you are simly the best.and you have really nice voice. Its so cool!!!!

  13. I loved this man…can you do another one explaining how to link the random data to a user's input to consider a lucky winner.

  14. Hi, Corey and anyone reading this. How about seed() method? I've read about it, I tried to understand its use, but can't get to know exactly what its use is. Any help is welcome.

  15. do you have an online text version of this ? so i don't have to type in your sample but just download it and learn.

LEAVE A REPLY

Please enter your comment!
Please enter your name here