I just started Python programming, and I'm wondering about the elif
keyword.
Other programming languages I've used before use else if
. Does anyone have an idea why the Python developers added the additional elif
keyword?
为什么不:
if a:
print("a")
else if b:
print("b")
else:
print("c")
最佳答案
Most likely it's syntactic sugar. Like the Wend
of Visual Basic.