Different meanings of brackets in Python

前端 未结 3 1658
时光说笑
时光说笑 2020-11-30 23:17

I am curious, what do the 3 different brackets mean in Python programming? Not sure if I\'m correct about this, but please correct me if I\'m wrong:

[] - # No         


        
3条回答
  •  情书的邮戳
    2020-11-30 23:41

    () parentheses are used for order of operations, or order of evaluation, and are referred to as tuples. [] brackets are used for lists. List contents can be changed, unlike tuple content. {} are used to define a dictionary in a "list" called a literal.

提交回复
热议问题