Performance of Various Methods to Test for a Palindrome [Python]

前端 未结 4 1879
梦谈多话
梦谈多话 2021-01-21 09:29

Today, I was fooling around with a couple of programming puzzles. Faced with the task of testing a string to see whether or not it is a palindrome, I conceived of several ways t

4条回答
  •  礼貌的吻别
    2021-01-21 10:02

    For timing small pieces of code like these functions, timeit can be very useful. Then you can find which one is faster yourself :)

提交回复
热议问题