mardi 1 septembre 2015

Carrying out a random-number generator x number of times based on user input

I am trying to make a random number generator with numbers 1-10 in Python, and I'd like it to generate a certain number of responses based on how many instances the user wants it. For example, the output for 5 responses would go something like this: 6, 1, 2, 9, 10, with each of those being randomly generated. Repeats are ok.

This is all I have so far (I'm not that experienced):

import random

x = int(input("How many times? "))

y = random.randint(0,10)

...and that's as much as I have. Please help!




Aucun commentaire:

Enregistrer un commentaire