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

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

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 –



Xem thêm bài viết khác:

Related Post


  1. I got to say: Thank you a lot! You got one more subscriber too.

  2. 7:27 random generated number code

  3. thanks a lot, this help me out with my survival game! very nice and simple!

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

  5. Thank you, This was exactly what I was looking for.

  6. 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?

  7. 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?

  8. 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

  9. what can I do if it says that "random" is not defined ?

  10. Thanks

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

  12. Hi could you prepare a video regarding the random.seed concept

  13. Perfect! Exactly what I was looking for

  14. What a dope video OMG.

  15. 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!

  16. great

  17. Great Video! You helped me a lot. Thanks👍

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


    import random





    why i cant define my shuffle in a new cariable?

  19. Great teaching Corey!

  20. Thank you! This really helped 🙂

  21. great video, happy that I' ve found your channel

  22. Thanks man!

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

  24. Nice VIdeo

  25. How would you ensure that you don't get any duplicate name/address?

  26. good for random sauce generating

  27. cool video !

  28. 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.

  29. 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 :/

  30. 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


  31. thumbs up if you came here for Qazi.

  32. This would be great to make an old school RPG with accuracy rolls for attacks

  33. 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!!!!

  34. Thank you, best course of python I have ever found

  35. 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.

  36. this was exactly what I was looking for, thanks!

  37. settings > playbackspeed > 0.5 speed

  38. Let's Have a Quick look Video Long is 13 minute that was quicker than light

  39. 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.

  40. 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.

  41. does not work for me for some reason, idk y

  42. Thank you Corey for your time and effort. Keep spreading the knowledge.


Leave a Reply