Question

Question 1: Write a python program that finds all numbers divisible by 7 but not multiple...

Question 1: Write a python program that finds all numbers divisible by 7 but not multiple of 5. The range of number for searching is between 2000 and 3200 (both included). Output should be printed in a comma-separated sequence on a single line .

0 0
Add a comment Improve this question Transcribed image text
Answer #1

X La *cj.py - C:\Users\Basheer\Desktop\cj.py (3.7.4)* - O File Edit Format Run Options Window Help n=[] #take n as empty list

Le Python 3.7.4 Shell - O X File Edit Shell Debug Options Window Help Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29

CODE:

n=[] #take n as empty list
for x in range(2000,3201): #take range from 2000 to 3200
if(x%7==0) and(x%5!=0): # condition divisible of 7 and not multiple of 5
n.append(str(x)) #append to empty list n
print(','.join(n)) #print separated with single line

Add a comment
Answer #2

num=[]

for i in range(2000,3200):

    if(i%7==0) and (i%5!=0):

        num.append(i)

print(num)        


answered by: Shahzain Hussain
Add a comment
Know the answer?
Add Answer to:
Question 1: Write a python program that finds all numbers divisible by 7 but not multiple...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT