Get Mystery Box with random crypto!

Good Job, Jasurbek. It is D. := is a walrus operator, a feat | Timur Soliev - Revival

Good Job, Jasurbek. It is D.

:= is a walrus operator, a feature whose alpha release was first seen in Python 3.8. Its main job is to assign values to variables as a part of a larger expression. Therefore, here we can assign the value of x in the list comprehension to the variable number by updating its value.

No matter how many x variables there are in the list, all of them are going to take what the variable number has as a value because that is what the list comprehension lots_of_numbers dictates here. If there were not if (number := x) expression in the last part of the comprehension, then the value of the number would not change, but since it is not like that, its value will be updated by the value of x each time the for loop runs and it will be left with the last value of x.

Since there is a range function which starts from 5 and continues till 100 by stepping by 2, it will assign the values in [5,7,9....95,97,99] to the x, but because no matter what the value of x, the lots_of_number list will look like this: [number, number, number ... number]. (99-5)/2 is the number of number variables in the list.

Since variable names are just references to objects in Python, and here the variable reference object x is being updated thanks to the for loop, the number variable will point to different values of x in each for loop run, but the value that stays with it will be the last value of x, which is 99.

So the eventual lots_of_numbers list will look like this: [99, 99, 99, 99 ..., 99, 99]

@TimurSoliev