The randint() function in a random module returns a randomly generated integer in the given range. acknowledge that you have read and understood our, GATE CS Original Papers and Official Keys, ISRO CS Original Papers and Official Keys, ISRO CS Syllabus for Scientist/Engineer Exam, Adding new column to existing DataFrame in Pandas, Python program to convert a list to string, How to get column names in Pandas dataframe, Reading and Writing to text files in Python, isupper(), islower(), lower(), upper() in Python and their applications, Taking multiple inputs from user in Python, Python | Program to convert String to a List, Different ways to create Pandas Dataframe, Python | Split string into list of characters. Want to create a game with random numbers? x = random.choice ( [3, 5, 7, 9]) print(x) Try it Yourself ». Python | Get key from value in Dictionary, Python - Ways to remove duplicates from list, Write Interview
You can also say the uniform probability between 0 and 1. Random Numbers with Python 3. To perform this task you must have to import NumPy library. Note: This method is an alias for randrange (start, stop+1).