Advertisement
here2share

# b_parse_string_to_tuples.py

Jan 3rd, 2022
1,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. # b_parse_string_to_tuples.py
  2.  
  3. from ast import literal_eval
  4.  
  5. zzz = '''((1, 2), (3, 4), (5, 6), (7, 8), (9, 0), ([0], "It's Python!"), (-2, 'a'))'''
  6. for z in literal_eval(zzz):
  7.     print(z)
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement