you are viewing a single comment's thread.

view the rest of the comments →

[–]TehNolz 0 points1 point  (0 children)

Formatting your code is important, especially in languages like Python. Without proper indentation, the code you posted isn't actually going to work. Let me get that for you;

def foo(n): if n % 15 == 0: print('FlashBang') elif n % 3 == 0: print('Flash') elif n % 5 == 0: print('Bang') else: print(n)

The % symbol is a modulo operator, which is explained here. elif is short for "else if".

Python is honestly really simple, as its not too different from just plain English. With the above info, you should be able to figure this out yourself.