18/19 Review: Modules


I would like to know why when I tab the print line, it became an error. Thanks!

from math import sqrt       < Correct
print sqrt(13689)
from math import sqrt       < Error
    print sqrt(13689)


Because of indentation rules. You cannot indent when indent is not needed, python is very exact about when to indent and when not to indent. :slight_smile:

Hope this helps!


However, I still can't figure out why return needs tab but print doesn't. :frowning:


It's not about return or print its about when to indent and when not to. Automatically when you need to indent python will do it for you. :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.