here2share

# break_list_comprehension.py -- just a little hack

Jun 21st, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. # break_list_comprehension.py -- it actually has a very odd purpose
  2.  
  3. a = 'abc123xyz'
  4. b = 'abc123zzz'
  5. c = ''.join(list(next(iter([])) if a[x]<>b[x] else a[:x+1][-1] for x in range(len(b))))
  6. print c
Add Comment
Please, Sign In to add comment