Guest User

Untitled

a guest
Jul 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. status = []
  2. i = 0
  3. while (i < 1000):
  4.     status.append(False)
  5.     i = i + 1
  6.  
  7. def go_through(student):
  8.     student = student + 1
  9.     length = len(status)/student
  10.     i = 1
  11.     while (i <= length):
  12.         index = i *student -1
  13.         status[index] = not (status[index])
  14.         i = i + 1
  15.  
  16. num = int(raw_input("Enter x => "))
  17. map(go_through, xrange(num))
  18. print len([n for n in status if n])
Add Comment
Please, Sign In to add comment