Nov-29-2018, 11:14 AM
Hi,
I have to write a program:
1. User enters the upper and lower range.
2. The code generates a random number, divisible by x and y.
I have to use the random module and list comprehension.
x=5 and y=7
I've done this so far...
I have to write a program:
1. User enters the upper and lower range.
2. The code generates a random number, divisible by x and y.
I have to use the random module and list comprehension.
x=5 and y=7
I've done this so far...
low=int(input("Enter start number:")) upp=int(input("Enter end number:")) for i in range (low,upp+1): if(i%7==0 and i%5==0): import random list_nums = ["low","upp"] random.choice(list_nums)Thanks in advance for your help!