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.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
How do you get random in Python?
+3
votes
asked
Sep 26, 2020
by
Average Drone Pilot
(
150
points)
#random-numbers
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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)
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Sep 28, 2020
by
Jayden Neifert Reeves
(
530
points)
https://machinelearningmastery.com/how-to-generate-random-numbers-in-python/
here you go, buddy!
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
...