3 ms·
In python there's no such thing as a char, there's only single-character strings. The above would actually be doing 6 string comparisons. That may still be fast
by vilya 15y ago
In python there's no such thing as a char, there's only single-character strings. The above would actually be doing 6 string comparisons. That may still be faster... or may not. Measuring is the only way to be sure.