Fellow Python gurus
I’ve been doing a project in the Python 3 course and was getting slightly unexpected results. After careful comparison to the solution notebook I’ve tracked down where the issue is coming from but I can’t understand why the slight difference in code would generate different outcomes. It all comes down to the following list comprehension:
possible_ms = [m /10 for m in range(-100, 101)]
possible_ms = [m * 0.1 for m in range(-100, 101)]
The list generated from either of these lines looks the same but when applied to subsequent calculations seems to produce different results. I must be missing something simple here! Any ideas?