Function error

  • Thread starter sandhyaranimangipudi
  • Start date

S

sandhyaranimangipudi

I am new to python, pls help me to resolve the below error

.... """Print a Fibonacci series up to n."""
File "<stdin>", line 2
"""Print a Fibonacci series up to n."""
^
IndentationError: expected an indented block
 
Ad

Advertisements

J

John Ladasky

I am new to python, pls help me to resolve the below error






... """Print a Fibonacci series up to n."""

File "<stdin>", line 2

"""Print a Fibonacci series up to n."""

^

IndentationError: expected an indented block

Python uses indentation to delineate blocks of code, instead of (for example) curly brackets. Add some white space (the convention is four characters) after at least the first line that ends with a colon, and then indent every line that is in the code block accordingly. Like this:

def fib(n):
"""Print a Fibonacci series up to n."""
do_something()
do_something_else()
 
Ad

Advertisements

T

Terry Reedy

I am new to python, pls help me to resolve the below error

Please read the nice tutorial, though no necessarily all at once. It
explains things like this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top