Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def last(): return["".join(["*" if (50 >= x and float(x**.5).is_integer()) else "-" for x in xrange(1,51)])]
- from __future__ import print_function
- def accessCell(row = 50, column = 0):
- for column in xrange(( 1 if column == 0 else column),(51 if column == 0 else column + 1)):
- factors = len(list(x for x in xrange(1,row + 1) if column % x == 0)) # Loop through each preceding row and add to set if the element is a factor of our column + 1 to include self.
- print("-" if (factors % 2 == 0) else "*", end="") # Return "-" if even, only an uneven number of changes can leave our light in the on state.
- print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement