Python Random Number Generators

Posted by freegiftcardgenerators on July 3rd, 2019

Python, being one of the easiest and most versatile languages to learn means that just about anyone with an inkling of coding skills can get into it quite easily. So I will quickly discuss some ways to go about making a random number generator and by doing so, you'll be able to familiarize yourself with some python code you may not have used in the past. I hope that some of what I will go over here will be useful to you in your future projects! Without further adiue let's get into it!

First let's get some sample code to get things moving and i'll go over what it does:

import random
for x in range(10):
  print random.randint(1,101)

The code above is very simple and all it does is print 10 random values between 1-100.

Line two is where we declare how many numbers to actually print.
Line three we print all numbers within a given range. It's important here that whatever number you stop on goes one over.

Now this is the basics, in my next article i'll get way more in-depth and advanced and we'll
learn how to add alphabetical characters both upper, and lowercase as well as the ability to
control the length of the code. After that I'll show how to hyphenate strings to get something
like this: S5Gv7-s24nJ and more. This can be used in applications such as:
Random Gift Card Code Generators

Like it? Share it!


freegiftcardgenerators

About the Author

freegiftcardgenerators
Joined: July 3rd, 2019
Articles Posted: 1