Python 3 Programming Tutorial - Functions

preview_player
Показать описание
The idea of a function is to assign a set of code, and possibly variables, known as parameters, to a single bit of text. You can think of it a lot like why you choose to write and save a program, rather than writing out the entire program every time you want to execute it.

To begin a function, the keyword 'def' is used to notify python of the impending function definition, which is what def stands for. From there, you type out the name you want to call your function. It is important to choose a unique name, and also one that wont conflict with any other functions you might be using. For example, you wouldn't want to go calling your function print.

Bitcoin donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6
Рекомендации по теме
Комментарии
Автор

The sound his keystrokes make are just so soothing.

hammadmk
Автор

Thank you for keeping it terse, brief, and not having an obnoxious intro and outro. 10 out of 10

--Valek--
Автор

after struggling for almost an hour with seeing results, with a 4 mins explanation, I have finally got it!

kaboyomichael
Автор

Really great video, brother!
I was having problems in understanding the function module of python... But now I got the basics...
Again thanks

cubebrothersbn
Автор

Soo i thought it's difficult until i saw your video. You made it easy for me! Thanks!

heniekhenkowski
Автор

This was huge. I am trying to learn Python on SoloLearn and I couldn't figure out why my projects were all coming back blank. thanks so much. I tried the function () like you did at the end of my code and it didn't work until I added the arguments inside again. Not sure why your string worked without the arguments and mine didn't but either way thanks again!

andrewwilliams
Автор

Love the short videos keep up the great work

benferree
Автор

Is there a way to call a function reference held in a list/dictionary?. i.e. can i store a list of functions/ methods in a list (they are, after all, just references) then call them in sequence or indexed from the list.

wktodd
Автор

Your videos are so so so so HELPFUL :) You making coding easy

hassankamal
Автор

Very simple to follow. Thanks a lot man!

dishydez
Автор

I am doing these exercise on Jupyter Notebook. When I enter a "def" function, it does not give me an outcome. my code was:def example():        print ('the')example()I get no errors but I also get no outcome, as in "the" does not print. Is there something I need to adjust in jupyter notebook? I enter the same code in spyder and I get "the" to print out. Please help & Thank you

Johnt
Автор

print('Your videos are so helpful')
print('I think i love you??')

fatmandoubblescoop
Автор

can i get a link to this python. i had to download visual studios and i hate it

plop
Автор

Perfect videos we are using them in our school ;)

shantkalaidjian
Автор

cover all the necessary detail, thanks so much.

jerryhuang
Автор

This was a helpful video to understand functions, after looking for few videos i found this good. Will check other videos too. I am beginner in programming, will iy be easy to get good hold on it ??

roshanshah
Автор

Why we don't asign a data type to a variable in python

subhadeepdas
Автор

Every time I try it says string is not callable

GamingMasterAnthony
Автор

Thank you very much for that series of educational videos

lisaolbert
Автор

Hi Sentdex,

I want to watch your first video tutorial. I searched down but didnt please send me a link of the first tutorial. M ew to python I hope you will understand.

ArunKumar-wvqo