Guest, before posting your code please take these rules into consideration:
It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
Don't share a wall of code. All we want is the problem area, the code related to your issue.
It's actually quite easy to create a generator for a random number in Python.
If you want to generate just a single random number then:
Python:
import random as r # Imports Python's random module.
# Use r.randint(...) to generate a random number between 0 and 100, and then print it out.
print(r.randint(0, 100))
If you'd like to generate more than one random number, then use:
Python:
import random as r # Imports Python's random module.
# Generate 5 random numbers using r.randint(...) inside of a for-loop.
for I in range(5):
print(r.randint(0, 100))
It's actually quite easy to create a generator for a random number in Python.
If you want to generate just a single random number then:
Python:
import random as r # Imports Python's random module.
# Use r.randint(...) to generate a random number between 0 and 100, and then print it out.
print(r.randint(0, 100))
If you'd like to generate more than one random number, then use:
Python:
import random as r # Imports Python's random module.
# Generate 5 random numbers using r.randint(...) inside of a for-loop.
for I in range(5):
print(r.randint(0, 100))
Python is an easy language to learn, mainly because it was designed with beginners in mind. But even then, somebody like yourself with prior experience in another programming-language, should be able to pick it up fast(If you don't know any fundamentals of object-oriented programming such as classes, you may find it hard depending on how you interpret and understand these concepts).
Python is an easy language to learn, mainly because it was designed with beginners in mind. But even then, somebody like yourself with prior experience in another programming-language, should be able to pick it up fast(If you don't know any fundamentals of object-oriented programming such as classes, you may find it hard depending on how you interpret and understand these concepts).