Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Convert string of digits to array of integers

📅 2009-Sep-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ lists, python, strings ⬩ 📚 Archive

digStr = “012345” digList = list(map(int, digStr)) # [0, 1, 2, 3, 4, 5]


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