A radius function

--Originally published at Monty Python and the Blogging Tale

So I wanted to create a simple function, and I needed to do a math homework; so as the great millenial that I am, I solved my problems by doing two tasks at once:

Behold my sphere function!

funcionI am really proud of my work, the only problem that I had was with converting the input to integers.

Ignore the comment at the beginning, I wast just testing if I knew how to use functions.


Creating/Calling functions

--Originally published at Python & pugs

For the creationf/calling of a function, you need first to call it by writing “def” in the beginning of the sentence, and “:” at the end, like this:
def name():

Now you have to give the function a purpouse:

def name():
example (“Functions”)
print(example)

After all this, you need to close the sentence with the name of your function:

def name():
example (“Functions”)
print(example)
name()

Haga click para ver el pase de diapositivas.