samedi 28 janvier 2017

Random Number Generator - That Stops

I am using python.

How can I make a code that generates random numbers between 1 and 1000 (inclusive) infinitely until it generates the number 39 and stops?

Here is what I've tried so far, however it has not worked:

import random

print(random.randint(1,1000))

if random.randint=39:

break




Aucun commentaire:

Enregistrer un commentaire