Skip to content

Instantly share code, notes, and snippets.

@staccDOTsol
Created May 5, 2022 22:38
Show Gist options
  • Save staccDOTsol/83ff0f8b5be942d26802a67539b5ad46 to your computer and use it in GitHub Desktop.
Save staccDOTsol/83ff0f8b5be942d26802a67539b5ad46 to your computer and use it in GitHub Desktop.
mmm modulus
#!/usr/bin/python3
for i in range(1,51): # iterates int 1 through 50
if i % 3 == 0: # test if divisible by 3
if i % 7 == 0: # test if divisible by 7
print('#{}\t'.format(i) + str(i % 7 == 0 and i % 3 == 0) + '\t CloudComputing') # if divisible by 3 & 7, prints iteration, arg response, and 'Computing'
else:
print('#{}\t'.format(i) + str(i % 7 == 0) + '\t Computing') # prints iteration, arg response, and 'Computing'
elif i % 7 == 0: # test if divisible by 7
print('#{}\t'.format(i) + str(i % 7 == 0 and i % 3 == 0) + '\t Cloud')
else:
print('#{}\t\t\t\tFUCK'.format(i))
else:
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment