← Back to challenges

Split Item Codes

PythonHardstringsregex

Instructions

You have a list of item codes with the following format: "[letters][digits]"

Create a function that splits these strings into their alphabetic and numeric parts.

Examples

split_code("TEWA8392") ➞ ["TEWA", 8392]

split_code("MMU778") ➞ ["MMU", 778]

split_code("SRPE5532") ➞ ["SRPE", 5532]

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Height of the Tallest Building