Guest User

Untitled

a guest
Aug 14th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. def PrintList(seq):
  2. string = ''
  3. for num in seq:
  4. if isinstance(num, list):
  5. string += '2^(' + str(PrintList(num)) + ')'
  6. continue
  7. else:
  8. string += '2^' + str(num)
  9. if seq.index(num) == len(seq) - 1:
  10. print(string)
  11. return string
Add Comment
Please, Sign In to add comment