a=1
while a<=100:
if a % 3 == 0:
print("foo")
elif a % 5 == 0:
print("bar")
print(a)
a=a+1
My output would print:
1
2
foo
3
4
bar
5
6
Instead of the output to be number 3, it should display the string (replace it)
how could I code a command that will replace the int with a string?
elseis your friendfor a in range(1,101)could be your friend too. Orfor a in range(1, 101, 5))forloop?