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
 
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()
 
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

Members online

Forum statistics

Threads
474,056
Messages
2,570,446
Members
47,098
Latest member
harrysmith

Latest Threads

Top