Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
  1. Member
    • CommentAuthorlego
    • CommentTimeMar 12th 2009
      0 points
    hello friends. i can't call python function from using python but if i put it in sum.py it works. what is the problem? i m just starting with python.

    >>> def calculate():
    ... print 1+2
    File "<stdin>", line 2
    print 1+2
    ^
    IndentationError: expected an indented block

    please help.
  2. Member
    • CommentAuthorroxan
    • CommentTimeMar 13th 2009
      0 points
    as the error suggest, there is problem with indentation.
  3. Administrator
    • CommentAuthorprasincs
    • CommentTimeMar 13th 2009
      0 points
    hi Lego.
    Here's what you need to do.
    >>> def calculate():
    ...<press-tab>print 1+2
    ...<press-enter>
    >>> calculate()
    3

    Cheers!
  4. Administrator
    • CommentAuthoradmin
    • CommentTimeMar 22nd 2009
      0 points

    lego, a good place to learn python in its entirety is http://docs.python.org

  5. Administrator
    • CommentAuthoradmin
    • CommentTimeMar 22nd 2009
      0 points

    do ask here if you have any trouble though.. ;)

  6. Administrator
    • CommentAuthorprasincs
    • CommentTimeMar 26th 2009
      0 points
  7. Member
    • CommentAuthorlego
    • CommentTimeApr 2nd 2009
      0 points
    ok i am liking this now.

    >>> def ilovepython():
    ... print "i am loving python";
    ...
    >>> ilovepython()
    i am loving python
    >>>

    thanks everybody.