I'm getting errors from the two loops below. Is there anything wrong with the syntax? I just started to learn how to use Jupyter Notebook.

I'm getting errors from the two loops below. Is there anything wrong with the syntax? I just started to learn how to use Jupyter Notebook.

You can not use python 2 syntax if you are using python 3 compiler.
Missing parentheses should give you a clear clue about how you should use print.