DEV Community

loading...

Discussion on: Python Foreach for Beginners

Collapse
highcenburg profile image
Vicente G. Reyes

I think you're missing a parenthesis on

for f in pets:
    print f
Enter fullscreen mode Exit fullscreen mode

When I ran it on Python 3.9, it returned

>>> for f in pets: print f
  File "<stdin>", line 1
    for f in pets: print f
                         ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(f)?
Enter fullscreen mode Exit fullscreen mode
Collapse
courseprobe profile image
Course Probe Author

Missing parentheses , great catch !!