Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How do you get random in Python?

+3 votes
asked Sep 26, 2020 by Average Drone Pilot (150 points)

3 Answers

0 votes
answered Sep 28, 2020 by Ishan Garg (140 points)
if you want to generate a random integer between two numbers

import random

x = random.randint(1, 9)
0 votes
answered Sep 28, 2020 by Jayden Neifert Reeves (530 points)
0 votes
answered Oct 6, 2020 by G4BR13l R0S4 (440 points)
numbers really aleatories it´s impossible but you can make this:

import random

numbers =('1' '2' '3' '4')

number =random.choice(numbers)

print number

this is a "aleatorie number" but dosn´t really aleatorie
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...