Write a program called factor.py that uses at least one loop to print out “Multiple of x!” for each element x that is a multiple of the factors: 5, 7, or 13 between zero and 100. If a number is a multiple of more than one factor, for example 35 is a multiple of both 5 and 7, print out “Multiple of 5 and 7!”. If all three are factors, then print out “Multiple of 5 and 7 and 13!”.
CODE IS PYTHON 3
for i in range(101): if(i%5==0 and i%7==0 and i%13==0): print("Multiple of 5 and 7 and 13!") elif(i%5==0 and i%7==0): print("Multiple of 5 and 7!") elif (i % 5 == 0 and i % 13 == 0): print("Multiple of 5 and 13!") elif (i % 7 == 0 and i % 13 == 0): print("Multiple of 7 and 13!") elif(i%5==0): print("Multiple of 5!") elif (i % 7 == 0): print("Multiple of 7!") elif (i % 13 == 0): print("Multiple of 13!")
Multiple of 5 and 7 and 13! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 13! Multiple of 7! Multiple of 5! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 13! Multiple of 7! Multiple of 5! Multiple of 5 and 7! Multiple of 13! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 13! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 7! Multiple of 5 and 13! Multiple of 5 and 7! Multiple of 5! Multiple of 7! Multiple of 13! Multiple of 5! Multiple of 7! Multiple of 5! Multiple of 5! Multiple of 7 and 13! Multiple of 5! Multiple of 7! Multiple of 5!
Get Answers For Free
Most questions answered within 1 hours.