python_scripting_cms
python_scripting_cms copied to clipboard
Introduce `elif` concept
Hi, thank you for the tutorial. I just have a suggestion on the use of elif clause instead of just if clause in this block:
https://github.com/MolSSI-Education/python_scripting_cms/edit/gh-pages/_episodes/02-file_parsing.md#L256-L268
...
for line in saptlines:
if 'Electrostatics ' in line:
electro_line = line
important_lines.append(electro_line)
if 'Exchange ' in line:
exchange_line = line
important_lines.append(exchange_line)
if 'Induction ' in line:
induction_line = line
important_lines.append(induction_line)
if 'Dispersion ' in line:
dispersion_line = line
important_lines.append(dispersion_line)
...
Thank you! I think we may be able to introduce elif (and else in lesson 1 under the heading "making choices"). We use an if statement to get number less than 0, elif could be used to capture numbers equal to zero, and else to get all else.
https://github.com/MolSSI-Education/python_scripting_cms/edit/gh-pages/_episodes/01-introduction.md#L344-384
is this issue still open ?