1

I have learned that to do nothing in python, one may use the pass keyword:

if True:
    pass

However, when I do this:

if True:
    ""

I seemingly get the exact same result. Nothing happens.

What exactly happens when I call pass vs. when I call ""? Is one minusculely faster or more efficient?

martineau
  • 119,623
  • 25
  • 170
  • 301
YulkyTulky
  • 886
  • 1
  • 6
  • 20

0 Answers0