I know this might be a very easy question but I can't get my head around it. The question asks to generate 357 random numbers between 8 and 254 (inclusive) and print out the largest generated number that is exactly divisible by 7.
I wrote this program:
import random
def main():
for x in range(357):
print (random.randint(8,254)*7),
print
main()
which generates the numbers but I don't know how to get the max number out of it. I would really appreciate any help đ
Aucun commentaire:
Enregistrer un commentaire