+ 1

Python define function error

I am getting error when defining function in Python using command prompt. I dont know how to exit def function. Normally python runs with >>> and when defining it changes to ... I get error even when I enter return command. Please help.

28th Aug 2019, 5:03 AM
Harmony Music
Harmony Music - avatar
1 Answer
+ 5
When you get ... in IDLE, it means that the interpreter is asking for additional input. Continue defining your function. Remember to indent the next line to make it a block of the function. >>> def myFunc(x): ... print(x) ... >>> Finish defining the function with a blank line.
28th Aug 2019, 5:09 AM
Hatsy Rei
Hatsy Rei - avatar