Python 3 Tutorial for Beginners #12 - Functions

preview_player
Показать описание
Hey ninjas, in this Python 3 tutorial I'll introduce you to functions Functions in Python are basically a chunk of re-usable code that we can call on whenever we need to run it.

----- COURSE LINKS:

---------------------------------------------------------------------------------------------
Other tutorials:

----- NODE.JS TUTORIALS

============== The Net Ninja =====================

================== Social Links ==================

Рекомендации по теме
Комментарии
Автор

My mind is just slowly being blown by your videos in this series. Thank you so much for taking the time to put these together!
There's a good chance I'll be watching most of them, if not all. You're a really great teacher.

TheRealFaceyNeck
Автор

Great tutorial! Thank you for the lessons!
I fiddled around, looked up some info and decided to write a code, where depending on the time right now, the output will change. :)

def greet(name, time):
print(f'Good {time} {name}, hope you are well')

import time # This imports the 'time' module
hours = time.strftime('%H') # We only need to know hours

name = input('Enter your name: ')

if int(hours) < 12: # If the hours right now are less than 12, then..
time = 'morning' # ..the 'time' variable will be 'morning'
elif int(hours) < 18: # If the hours are less than 18, then..
time = 'day' # .. it is 'day'
else: # Otherwise, it must be..
time = 'evening' # .. evening!

greet (name, time)

DireStraitsInImpala
Автор

At 10:08 you didn't pass function as parameter, you just passed another (area) function's return value as parameter. This might not seem to be a big think, but they represents something different in JS as you know (where functions are first-class citizens). Though I don't know (yet) if that applies for Python too (that is whether functions are being the first-class citizens or not).
Besides that awesome tutorial as always, thanks.

ozanmuyes
Автор

the playlist is really helpful, just want to know if there is a updated playlist regarding PYTHON!!

aayushmittal
Автор

the default values are useless if the user doesnt enter values into the input? how would youd deal with that situation

JeffBarron
Автор

can u make a nodejs + mysql app tutorial focusing on mysql data managment ?

Albertmars
Автор

How do you get Atom Editor to accept input?

stitchfire