Home > other >  python
python

Time:10-08

Want to ask what is the difference between the following two?
L=[L] [I - 1 + L [I] for I in range (1, len (L))]

For I in range (1, len (L)) :
L=[L] [I - 1 + L [I]

CodePudding user response:

The difference between big:
The first is a list of deduction, to the right of the first expressions to perform again after the completion of assignment to the left of the L
The second is the for loop, cycle time will L assignment once again,