python 数字整除
Given a range (which is 1 to 1000) and we have print all numbers which are divisible bye 7 and not divisible by 5 in python.
给定一个范围(1到1000),我们打印了所有在python中可被7整除而不能被5整除的数字。
Example:
例:
Input:
Given input range is 1 to 1000
Output:
7, 14, 21, 28, 42, 49, 56, ...
Logic:
逻辑:
To implement this logic, we will use a for and in loop with range() method. The statement of range() method with the minimum to maximum range is range(begin, end+1).
为了实现此逻辑,我们将使用