Intermediate Python Tutorial #1 - Optional Parameters

preview_player
Показать описание
Welcome to a new series! Intermediate Python Tutorials!

Today's Topic: optional parameters, these are an extremely useful tool to use within methods and functions to set a default value for any given parameter.

In this set of videos I will be explaining more advanced programming concepts and showing you intermediate-advanced tools that you can use in python. A lot of these tools will help you to solve problems/code more efficiently and will save you a ton of time!

Future topics:
2. Static and Class Methods
3. Map Function
4. Filter Function
5. Lambda Functions
6. Intro to Collections
7. Collections: named tuple
8. Collections: deque
9. Collections: orderedDict
10. Collections: defualtDict
11. docstrings

Want To Support This Channel?
Bitcoin: 1PbkAYLFaJBgjbKn2ptGyBz65xWN8hJgBU
Ethereum: 0xdd42dbbdba60f7163fc7a840e189474b6e8bfcad
Ripple: rD4arM9CVjQWqi8f1kxdpCgkCgEkqBgtud

Please leave a LIKE and SUBSCRIBE for more content!

Tags:
- Tech With Tim
- Python Tutorials
- Intermidiate Python Tutorials
- Optional parameters in python
- Python tutorials
- Python intermediate tutorial
Рекомендации по теме
Комментарии
Автор

In the example where you have multiple default parameters and you only want to access the last parameter(freq for his case), you don't have to assign add as 5, you can explicitly call freq to be equal to 3.

def func(word, add=5, freq=1):
print(word*(add+freq))
func("hello", freq=3)

this leaves add as the default and only affects freq

ChettahZpeed
Автор

Bro can you zoom in a lil bit.
And thanks for the new lesson.

milanpaudel
Автор

Great, I'm happy you are still creating videos, I love them, keep the great work up please!

leonardpasieka
Автор

Guys like you are just monuments,
Just teaching and trying to explain as well as you can...
I Just was scrapping chrome to find some great video,
And I landed here,
Beutiful...👍,
KEEP IT UP 👌

khushimishra
Автор

Timot, You could make a Udemy Course.
This different playlist of python is very Helpful for Beginners.

rishabkumar
Автор

Please make tutorials on making pac man using pygame

aryanbhatia
Автор

Thanks a lot... I'm getting into it...

class person(object):

def __init__(self, name, age, body_Weight, height):
self.name = name
self.age = age
self.body_Weight = body_Weight
self.height = height

def definition(self, age_Stage=True):
print("Your name is %s, you're %s years old. You have a body Weight of %s pounds, and a height of %s ft." %(self.name, self.age, self.body_Weight, self.height))
print("Based, on his age: ")
if age_Stage == True:
print("You are an adult")

if age_Stage == False:
print("You are not an adult")

p1 = person('Jonny', '30', '180', '6')
p1.definition(True)

melidobello
Автор

1:26 is the first time I’ve heard him pronounce the letter Z as “zee”

AndresJ
Автор

I learned more in these 9 minutes than my 1hr coursera courses

hicarlee
Автор

Didn't understand the last one please make a separate video and describe every line....hoping for ur positive response

amazingmaths
Автор

Why do we need to learn this when we can just print what we want . Its more simple .
We can just print it agian if we need it multiple times in our program .

Rayantheproofficial
Автор

%s where was this explained? It was not, even in beginner's video

kaaljai
Автор

didn't you do this in the beginner class?

Sciencedoneright
Автор

Am SOOO GLAD for THIS You're great!!!!

deus
Автор

can't seem to make the %s %s to work. gives the error "TypeError: not all arguments converted during string formatting".
But I know the " {} ".format(variable_name) thing and it worked out.

def display(self, showAll):
if showAll:
print("This car is a {} {} from {}, it is {} and has {} kms." .format(self.make, self.model, self.year, self.condition, self.kms))
else:
print("This car is a {} {} from {}." .format(self.make, self.model, self.year))

jccatilo
Автор

This is so fun! doesn't even give the tutorial hell thing!

Sciencedoneright
Автор

Why do you always use self.(argument) is there a spesific reason

wietskevanderwesthuizen
Автор

Heyy Tim!! Start solving Leetcode on your channel.

SE__VaishnaviKorgaonkar
Автор

*You know Tim is ill if he forgets to put spaces between * * **

Sciencedoneright
Автор

hi, great video. your tutorials are very helpfull. why is needed the if/else in the dipslay function?

setxua