1
Hello,
I’m doing the following program:
The programme shall print on the screen all numbers which are divisible by 7 but are not multiples of 5 between 3000 and 3200 (inclusive).
Turns out I’ve done the code, but this one’s not working the right way, and I’m having trouble solving it.
print("="*25)
print("Números divisíveis por 7")
print("="*25)
# modifique as 2 proximas variaveis para testar o programa
numeroDe = 3000;
numeroAte = 3200;
pares = 0;
impares = 0;
divPorSete = 0;
while (numeroDe <= numeroAte):
if numeroDe % 2 == 0:
pares += 1;
else:
impares += 1;
if numeroDe % 7 == 0:
divPorSete += 1;
numeroDe += 1;
print ("Resumo de divisiveis entre ", numeroDe, " e ", numeroAte)
print ("\t- Números pares: ", pares)
print ("\t- Números impares: ", impares)
print ("\t- Números divisiveis por 7: ", divPorSete)
I ask for your help.
Have you tried anything? Put in that code that you have pff
– Miguel