191k views
1 vote
22. How many positive integers less than 1000 are divisible by 7?

User LanDenLabs
by
9.0k points

1 Answer

4 votes

If we want to write Python code to find the answer this question;

x=1

count=0

while(x!=1000):

if(x%7==0):

count+=1

x+=1

else:

x+=1

continue

print("There are ",count," numbers which divisible by 7.")

The output will be There are 142 numbers which divisible by 7.

User Macho Matt
by
8.5k points

No related questions found