Skip to content

Instantly share code, notes, and snippets.

@Programmer-RD-AI
Created January 17, 2025 18:37
Show Gist options
  • Save Programmer-RD-AI/789df6a65cb5875b80155b97e0e7cc25 to your computer and use it in GitHub Desktop.
Save Programmer-RD-AI/789df6a65cb5875b80155b97e0e7cc25 to your computer and use it in GitHub Desktop.
Program that prints out the numbers 1 to 100 (inclusive). If the number is divisible by 3, print Crackle instead of the number. If it's divisible by 5, print Pop. If it's divisible by both 3 and 5, print CracklePop.
for num in range(1, 101):
if num % 3 == 0 and num % 5 == 0:
print("CracklePop")
elif num % 5 == 0:
print("Pop")
elif num % 3 == 0:
print("Crackle")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment