0

This is very basic issue with me right now. I don't know how to write a function or class in python. I mean i know the syntax but i don't know how to escape from the indentation while typing on IDLE.

For example

def sum():
    var1=10;
    var2=20;
    sum=var1+var2;

#how to get to this line in IDLE? to write comment or further statements?

now i want to escape from the indentation and call the function wihout causing the function to break and IDLE is throwing error when i do that. I know this is very simple issue but i just can't get my hands on jusing the IDLE or say python code in command line which i want to write.

Is there any tut on web that lets me know how to use command line python effectively or say using IDLE effectively? I know i should be using IDE to save time and all but this is something too hard to miss if i'm learning python.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by arunpawar
0

You are typing your function to new window in IDLE, by Ctrl-N or File - New Window aren't you? Then you can just choose to run the file with F5 or choose Run - Run Module from menu.

0

I figured it out it's backspace to go to new line. I know it was silly question but have to test a lot for this. Thanks for the help. I don't know if this is same in the command line or say bash prompt? have to test that.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.