Say for example I want to split string "12:30-14:40" and have the result in a matrix like: [["12","30"],["14","40"]].
I can do this in JavaScript with:
"12:30-14:40".split("-").map(function(x) {
return x.split(':');
});
and in Ruby with:
"12:30-14:40".split("-").map{|x| x.split(":")}
What would be the python equivalent for the above?
In Python and using
map()you will have something like: