I am trying to convert my output as:
[5130, 5415, 5700, 5985, 6270, 6555, 6840, 7125, 7410, 7695, 7980]
but I only get:
5130
5415
5700
5985
6270
6555
6840
7125
7410
7695
7980
I have no clue how to convert it. I am inputing the number 15.
my code:
x = int(input("Enter your number here: "))
def inrange(x):
for i in range(5000,8000):
if i % x ==0 and i % (x +4)==0:
print(i)
inrange(x)
This is the question: Create a program that has a function that takes one integer argument. The function will print a list of all values between 5000 and 8000 that is divisible by (1) the integer argument, and (2) the argument + 4.
question from:
https://stackoverflow.com/questions/65908389/how-do-i-convert-my-output-to-list-format 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…