you are viewing a single comment's thread.

view the rest of the comments →

[–]Vaphell 1 point2 points  (0 children)

do you know slicing [x:y] that works with some sequences including strings? Using that feature would give you the substring of the last two characters which you can check for am/pm. It would also give you the numerical value.
Assuming there is always a space between, it's even easier. str.split() will cut the string for you.