Guest User

Thue-Morse Sequence

a guest
Aug 4th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. x=input()
  2. y='0'
  3. print y
  4. def Creator(x,y):
  5.     if x ==0:
  6.         return y
  7.     for p in y :
  8.         if p =='0':
  9.             y+='1'
  10.         else:
  11.             y+='0'
  12.     print y
  13.     return Creator(x-1,y)
  14. Creator(x,y)
Advertisement
Add Comment
Please, Sign In to add comment