data-centric-computing / dcic-public

Repository for (for now) filing bug reports about DCIC.
19 stars 2 forks source link

[DCIC Book]: Wrong comment character used in Python code #80

Open profsmucker opened 1 month ago

profsmucker commented 1 month ago

Contact Details

No response

Which Web page has the problem?

https://dcic-world.org/2023-02-21/intro-python.html

What's the problem?

This Python code uses the // operator mistakenly instead of the # comment character:

def all_z_words(wordlist : list) -> list:
    """produce list of words from the input that contain z"""
    zlist = [] // start with an empty list
    for wd in wordlist:
        if "z" in wd:
            zlist = [wd] + zlist
    return(zlist)

What browser are you seeing the problem on?

Chrome