Python default arguments are awesome! 👍
ฝัง
- เผยแพร่เมื่อ 1 มิ.ย. 2024
- #python #tutorial #course
00:00:00 default arguments
00:03:16 exercise
---- EXAMPLE ----
def net_price(list_price, discount=0, tax=0.05):
return list_price * (1 - discount) * (1 - tax)
print(net_price(500))
print(net_price(500, 0.1))
print(net_price(500, 0.1, 0))
---- EXERCISE ----
import time
def count(end, start=0):
for x in range(start, end+1):
print(x)
time.sleep(1)
print("DONE!")
count(10)
count(30, 15)
# ----- EXAMPLE -----
def net_price(list_price, discount=0, tax=0.05):
return list_price * (1 - discount) * (1 - tax)
# print(net_price(500))
# print(net_price(500, 0.1))
# print(net_price(500, 0.1, 0))
# ----- EXERCISE -----
import time
def count(end, start=0):
for x in range(start, end+1):
print(x)
time.sleep(1)
print("DONE!")
# count(10)
# count(30, 15)
Please make more on default arguments...
Bro they actually are awesome I always use them
You deserve millions
It is absolutely great! I like python.
U are so good at explaining these concepts! Thank u!
Thank you for an awesome video. I found your videos while I was making a video on creating the Snake game in Python. Subscribed immediately 😆
Thanks for everything. Keep going.
Well explained ❤️
Your explanation is very good and clear. Love your vids bro
thank you so much for the video
amazingly underrated video, explained perfectly. thank you bro code
By any chance did you make any videos on introduction to Git & GitHub for beginners?... Ur videos are nicely explained and really thx, i really learned basics of python through your videos
thx 4 vid bro !
Good voice and excellent explanation 👍.
nice tut
You're amazing!!!
How are you so good at explaining stuff so easy
Perfect
defaults arguments are defaults,love them :) thx
wooow, ty for the vid ngl my teacher exaplaining this made no sence.
btw what does time.sleep(1) do?
Cool buddy 😎 👍
Nice
How did you add Fundraiser symbol, can you please provide me some info.
Mr. Bro , you're awesome
Yeah, let's defeat the TH-cam algorithm 🥋
Well u can adjust the time in time.sleep() by how fast do u want to
Sir please make the video on sql sir
It can be used in a video game made in Python... 🤔
I am currently learning Java. Is this approach the same as "overloading methods" ?
very similar
Can you please make more java swing apps!!
I'm taking a break from Java for now, there's 150+ videos lol
Please make node js react vue js tutorials why all the time the same pyhthon and MySql
that's what people voted for in the past
@@BroCodez please do Nodejs
brooo
Such a Chad
def products(we_bougt, its_price, its_total_taxes):
print(f'we bought a {we_bougt}')
print(f'its total price is a {its_price} dollar')
print('total taxes is', its_total_taxes )
print('total is you will pay is a',its_price + its_total_taxes)
products('Xbox Series S', 550 , 0.15)
WE CAN MAKE SOMETHING ON LIKE THAT WE DO NOT NEED TO A RETURN THINGS:)))))
Fortnite default😂😂
תעשה לי ילד