I am unable to print output for this py program

Tell us what is happening:

Your Code:

def fun1():


What problem are you having. As long as the indentation is correct, that code will print 4.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

Now, as Ariel has said, you should edit your own post with the necessary information we need to help you.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


to call fun1 you need to write the function call outside of its definition. As it is indented, the function call fun1() is inside the definition of itself