Functions in Python
Hello, I am Şeyma, one of the participants of the SistersLab Women in Tech Academy project supported by Toplum Gonulluleri Vakfı (https://www.tog.org.tr/en/).
The project aims to empower people between the age of 20–28 who identify as women, through 3 months long software training and supporting training to increase their participation in the workforce in the IT sector.
You can access detailed information about the project using this link: https://sisterslab.co/women-in-tech-academy/
I will share with you what I learned about python as part of this beautiful project. I wish you good reading.
When we need to use a certain piece of code in a python application we have written in a few places, creating a function makes our work easier. In such cases, we can put the lines of code that we will use constantly into functions and call them and run them whenever we want.
Function Definition:
We use the def command to define a function.
Calling a Function:
Get İclal Şeyma Koca’s stories in your inbox
Join Medium for free to get updates from this writer.
We define functions, but the code inside the function block is not executed unless called. To call the function we must use the parentheses along with the name of the function.
Sending Parameters to a Function:
We can send information to functions from outside and use them inside the function.
Parameters can be increased as desired and are not limited to str only. Variables such as int float can be used in parameters.
In this story, I briefly talked about loops. I hope it worked for you. See you in another story.








