Try random.randrange
:
from random import randrange
print(randrange(10))
More Related Contents:
- How to generate random binary numbers 0 or 1 with length of N and with option to control the probability of having 0 or 1?
- How do I create a list of random numbers without duplicates?
- Python: TypeError: cannot concatenate ‘str’ and ‘int’ objects [duplicate]
- How do you round UP a number?
- Python strings and integer concatenation [duplicate]
- The `is` operator behaves unexpectedly with non-cached integers
- How to get a random value from dictionary?
- Weighted random selection with and without replacement
- Generate random numbers summing to a predefined value
- How does Python manage int and long?
- inheritance from str or int
- Is there a way to get the largest integer one can use in Python? [duplicate]
- Random state (Pseudo-random number) in Scikit learn
- How can I randomly choose a maths operator and ask recurring maths questions with it?
- Convert integer to string in Python
- Safest way to convert float to integer in python?
- Random is barely random at all?
- What does the random.sample() method in Python do?
- Generate a random sample of points distributed on the surface of a unit sphere
- Random without repetition?
- Creating same random number sequence in Python, NumPy and R
- Python: Choose random line from file, then delete that line
- How to convert signed to unsigned integer in python
- How can I generate a unique ID in Python? [duplicate]
- Convert all strings in a list to integers
- Shuffling NumPy array along a given axis
- scikit-learn random state in splitting dataset
- TensorFlow: Non-repeatable results
- Can I generate authentic random number with python?
- Generate random array of floats between a range