Skip to content

Introduce elif concept #59

@khoivan88

Description

@khoivan88

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)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions