Create a for-loop that loops from 0 up to and including 20. On each iteration, output a '*' (an asterisk) if the value of the counter variable is divisible by 2, a '@' if divisible by 3, and a '$' if divisible by 4. In all other cases, output a '!'. Each symbol should be printed on a different line.
for i in range(0,20):
if i%2==0:
print("*")
elif i%3==0:
print("@")
elif i%4==0:
print("$")
else:
print("!")
Comments
Leave a comment