Advertisement
DanielKoehler

Untitled

Nov 9th, 2013
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. def last(): return["".join(["*" if (50 >= x and float(x**.5).is_integer()) else "-" for x in xrange(1,51)])]
  2.  
  3. from __future__ import print_function
  4. def accessCell(row = 50, column = 0):
  5.     for column in xrange(( 1 if column == 0 else column),(51 if column == 0 else column + 1)):
  6.         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.
  7.         print("-" if (factors % 2 == 0) else "*", end="") # Return "-" if even, only an uneven number of changes can leave our light in the on state.
  8.     print()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement