You are viewing a single comment's thread. Return to all comments →
Nice work. Can be made even shorter by suming the test (True = 1, False = 0)
def marsExploration(s): return sum(s[i] != "SOS"[i%3] for i in range(len(s)))
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
Nice work. Can be made even shorter by suming the test (True = 1, False = 0)