lc-python-intro
lc-python-intro copied to clipboard
Suggestion on Conditionals Episode
With the Conditionals episode, examples are given using the variable mass or m inconsistently throughout the page. Although the code executes without errors, it would be kinder to a beginning learner to keep things consistent. Perhaps spell out the variable in the first exercise, then use it as a teaching opportunity to show how it can be safely abbreviated, for ease of writing/re-writing the code:
First example:
mass = 3.54
if mass > 3.0:
print(mass, 'is larger')
Then:
masses = [3.54, 2.07, 9.22, 1.86, 1.71]
for m in masses:
if m > 3.0:
print(m, 'is larger')
I'm afraid the example in the elif section has a mix of both, which prompted me to make this suggestion:
masses = [3.54, 2.07, 9.22, 1.86, 1.71]
for mass in masses:
if m > 9.0:
print(m, 'is HUGE')
elif m > 3.0:
print(mass, 'is larger')
else:
print(mass, 'is smaller')
Thanks @geospatial-gill. There is a major redesign planned for this part. We will keep the issue open.
Hi @konrad, Please let me know if you need any Testers for the redesigned lessons!
Closing since a major update to the lesson will soon be merged, deprecating most standing issues. Thanks for your contribution!