Skip to content

Instantly share code, notes, and snippets.

@deidyomega
Created December 9, 2016 02:23
Show Gist options
  • Save deidyomega/0b7c2df6c6efcd6aa4b3d7815fec4f59 to your computer and use it in GitHub Desktop.
Save deidyomega/0b7c2df6c6efcd6aa4b3d7815fec4f59 to your computer and use it in GitHub Desktop.
Code Fight Python (incorrect)
import pprint
def CodeFight(n):
lst = []
for x in xrange(1,n+1):
if x % 5 == 0:
o = "Code"
elif x % 7 == 0:
o = "Fight"
else:
o = str(x)
lst.append(o)
pp = pprint.PrettyPrinter(indent=0)
return pp.pprint(lst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment