Python, writing multi line code in IDLE

為{幸葍}努か 提交于 2019-11-29 07:20:02

Try File => New Window in top menu. Then write your code in this windows and run it by F5 key (or Run in top menu)

1: Use semicolons between lines
2: Try iPython
3: Write it as a function, e.g.

def myfunc():
    x = int(raw_input("Please enter an integer: "))
    if x < 0:
        x = 0
        print 'Negative changed to zero'
    elif x == 0:print 'Zero'
    elif x == 1:print 'Single'
    else:print 'More' 
Jayanth Reddy

Shift + Enter takes you to next line without executing the current line.

Can't write multi-line code in python console. Need a 3rd-party app.

Please use this combination: Shift + Enter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!