0

Write all the number of which is divided by 7 and multiply by 5from 1500 to 2700

By using while loop

2nd Dec 2019, 8:13 AM
Amazing Akash Gupta
Amazing Akash Gupta - avatar
6 ответов
+ 1
A way of finding multiples is by testing if the division outputs 0 as remainder. Thus, you can do something like this: i = 1500 while i <= 2700: if i % 7 == 0 and i % 5 == 0: print(i) i+=1 I advise you to use a for loop instead of a while loop: for i in range(1500, 2701): ... Happy coding!
2nd Dec 2019, 8:22 AM
Gonçalo Magalhaes
Gonçalo Magalhaes - avatar
+ 3
Amazing Akash Gupta This program seems easy. Have you ever tried to do self?
2nd Dec 2019, 9:08 AM
A͢J
A͢J - avatar
0
Do you mean all numbers that are multiple of 7 and 5, or all numbers that are multiple of 7, and just multiply them by 5 before being printed?
2nd Dec 2019, 8:16 AM
Gonçalo Magalhaes
Gonçalo Magalhaes - avatar
0
Yes divided by 7 and 5
2nd Dec 2019, 8:17 AM
Amazing Akash Gupta
Amazing Akash Gupta - avatar
0
Thank you for this but your first one program is not working
2nd Dec 2019, 8:41 AM
Amazing Akash Gupta
Amazing Akash Gupta - avatar
0
Yes that one is working
2nd Dec 2019, 8:41 AM
Amazing Akash Gupta
Amazing Akash Gupta - avatar