Coding Problem?

def printme(str):
print("Hello")


printme()

I am getting a IndentationError: expected an indented block error, I am trying to see if I simply type the variable will it return the
variables defined commands. Can someone explain this to me

2017-08-12T23:46:40Z

This is a python question

husoski2017-08-12T23:57:04Z

Favorite Answer

Your "def" statement begins a function definition. The statement that that make up the function (describe what's done when the function is executed) immediately follow the def statement and *must be indented*.

Python uses indentation instead of symbols or words, to group lines. So try this:

def printme(s):
.... print(s) # type spaces or a tab instead of .... at the front

printme("Hello")

That's changed a bit. Your original version expected an argument and would have failed with "printme() expected 1 argument but found 0" or something like that, because the printme() call at the bottom didn't provide an argument.

The .... token is a substitute for a tab or spaces. Y!A removes "extra" spaces, so you can't paste code here and have it appear properly indented.

brilliant_moves2017-08-13T06:46:21Z

I agree with husoski. It depends on what the question is asking for. Another working solution would be:

def printme():
... print ("Hello")

printme()

Remember to use spaces or a tab instead of "... ".