0
Python loop
How to find and print 4 numbers, put in a raw consecutively, that multiplied by each other equal to 1680? The output is 5, 6, 7, 8 (i.e. 5*6*7*8=1680)
4 Answers
+ 1
man, I need a code that calculates these numbers from the statement only. the output is the answer that I found mathematically - I need to do the same math calculations using the code! thanks!
+ 1
I have changed your script a little bit in accordance with the statement and it worked perfectly! THANK YOU, MAN!:
num = 1680
x = 0
for i in range(1,num-3,1):
a,b,c,d = i,i+1,i+2,i+3
pro = a*b*c*d
if pro == num:
print(a,"*",b,"*",c,"*",d)
x = 1