Scoping in Python 'for' loops

前端 未结 6 1182
名媛妹妹
名媛妹妹 2020-11-22 03:52

I\'m not asking about Python\'s scoping rules; I understand generally how scoping works in Python for loops. My question is why the design decisions were m

6条回答
  •  伪装坚强ぢ
    2020-11-22 04:30

    Python does not have blocks, as do some other languages (such as C/C++ or Java). Therefore, scoping unit in Python is a function.

提交回复
热议问题