Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Picking certain elements of a tuple returned by function

📅 2009-Oct-01 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ python, tuples ⬩ 📚 Archive

Problem: How to pick only first & third parts of 3-tuple returned by str.partition()?

part0, _, part2 = str.partition(' ')

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧