Difference between writing something on one line and on several lines

后端 未结 6 1523
我寻月下人不归
我寻月下人不归 2021-01-13 03:16

Where is the difference when I write something on one line, seperated by a , and on two lines. Apparently I do not understand the difference, because I though t

6条回答
  •  余生分开走
    2021-01-13 03:40

    The difference is because in the second example you set a to b before referencing a. Your values on the second example will be off. Here is an example:

    a = 5
    b = 6
    

    ex.1:

    a, b = b, a+b // a = 6 and b = 11
    

    ex.2:

    a = b // a = 6
    b = a + b // b = 6+6 or 12
    

    The first example is correct

提交回复
热议问题