Creating Functions
Function declaration or creating functions is different in different programming languages. Usually, a function keyword
is specified, followed by the function name
, parenthesis
(with function parameters
, if any), and then comes the body of the function
.
Now let's see how we can create functions in Python.
In Python, the def
keyword is used as the function keyword. This is followed by the function name, parenthesis, and a colon. The body of the function is denoted by an indentation.
xxxxxxxxxx
function javascriptFunc() {
console.log("Hello World!");
}
javascriptFunc();
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment