I have been working as a software developer since 2019. I have started coding since 2014. I have watched a lot of tutorials and read many books. But today I understood "Generator" properly. Thank you sir, you are really great. ❤❤
51:00 So, basically what I've understood, "yield" is kind of like the "static" keyword which is used in c/c++. when we say, "static int a = 5;" inside of a function & we call that function multiple times or call that function using a loop, that static variable "a" saves it's previous state in memory & performs the next tasks with it's previous state every single time function is called. not saying they are the same. But yeah, i found it familiar.
19:45 Precision can be achieved using round() function as given below: def circle_stats(radius): area=math.pi*radius**2 circumference=2*math.pi*radius return *round(area,2),round(circumference,2)* print(circle_stats(5)) (78.54, 31.42) *Further, can we round off multiple values at once instead of doing separately for each one?*
51:07 I have worked on some personal projects in deep learning and one use case of yield is handling huge amount of datasets where we need to fetch a batch of numbers from the datasets to perform calculation of gradients during backpropogation which is a way to optimized neural networks loss calculations
20:12 1) first method Below formatted variable will be displayed with 5 decimal values formatted = "{:.5f}".format(9.999875698989) print(formatted) # output : 9.99988 And suppose we write like this formatted = "{:.3f}".format(9.999875698989) print(formatted) # output : 10 Then it will return 10 as output. 2) using round() In this function we will pass two parameters, first is our value or variable and second is how many decimal values we want. Example_1: Number = 5.375829473 print(round(Number,2) # output : 5.36 Example_2 : print(round(5.53627894,2)) # output : 5.53
Thanks for such a simplistic, professional and in-depth content for question 6(26:06), I used this: cube = lambda user_in: user_in ** 3 user_in = float(input('Input a number for cube')) print(cube(user_in))
my mind is just tuned with all your words, they just directly print into my mind i just simply run those without any errors , i think you have hacked my mind....grate full to u sir
Learning Python day 10 - present sir 00:03 Introduction to functions in Python 02:16 Learning functions in Python with confidence 06:06 Variables and function parameters in Python 08:07 Using the return keyword to output a result from a function in Python 12:05 Polymorphism in Python functions 14:17 Creating functions to return multiple values in Python 18:22 Returning multiple values from a function in Python 20:22 Creating and handling functions in Python. 24:13 Creating a function to compute the cube of a number 25:53 Understanding function definitions in Python 29:25 Using Python's special parameters to handle input values efficiently. 31:21 Printing and investigating errors in Python functions 34:53 Functions in Python and their usage with keyword arguments 36:52 Understanding function definitions and arguments in Python 40:42 Using formatting strings to print values in Python functions 42:33 Creating a function to generate even numbers with a limit in Python. 46:37 Understanding function implementation in Python 48:38 Functions in Python use yield to produce a sequence of values 52:16 Creating a function to calculate factorial and understanding recursion 54:18 Recursive approach to calculate factorial in Python 57:56 Learned the key concepts of functions in Python
20:11 import math def circlestat(radius): area = math.pi * radius **2 circumference = 2* math.pi *radius return area ,circumference a,b = circlestat(6) a= round(a,3) b=round(b,3) print("area: ",a , "circumference",b) round() is used to take those values upto 2 or 3 decimal places only
Now I'm feeling that I'm diving into the internal working of python. The way he explains every topics that is phenomenal. I'm regularly waiting for his python series videos. Thanks sir for making this wonderful series.
To avoid those recurring decimal in solution_04, we can use round() method to avoid those recurring decimals and can convert it to 1 , 2 or any decimal place you like. Source Code: import math def circle_stats(radius): area = round(math.pi * radius ** 2,2) circumference = round(2 * math.pi * radius,2) return area, circumference a , c = circle_stats(3) print("Area: ", a, "Circumference: ", c)
import math def circle(radius): area = round(math.pi*(radius**2),2) circumference = round((2 * math.pi * radius) ,2); return area , circumference; r = int(input("Enter Radius: ")) a , c = circle(r) print("The Area is: ",a) print("The Circumference is: ",c)
We can use the f-strings functionality. For example, if we want precision up-to 2 digits, then we can type: - print(f"Area : {a:.2f} Circumference: {c:.2f}")
sir aapko killvish ko bhi add karna chahiye tha main villan ki tor pe wese is tarike se python ke function ko sikh kar ke maza hi aa gaya love from mumbai sir ji ❤❤
def area_circumference(a): area = (3.14)*(a)*(a) circumference =2*3.14*(a) print("area=",area) print("circumference=",circumference) a = float(input("enter the radius:")) (area_circumference(a))
Could you please consider launching a new series on core advanced Java? Topics like concurrency, JVM internals, and performance optimization would be really helpful. Looking forward to more great content from you!
Sir,For the question no.3 When two inputs are taken from the user like one is int and other is string types without direct passing as an argument then what will be happend ??
I know some basics of python but whenever I watch your videos , I consistently gain new insights and knowledge.
But your code shows errors lol
I have been working as a software developer since 2019. I have started coding since 2014. I have watched a lot of tutorials and read many books. But today I understood "Generator" properly. Thank you sir, you are really great. ❤❤
19:52
import math
def circle_stats(radius):
area = math.pi* 2 * radius**2
circumference = 2 * math.pi * radius
return area, circumference
a, c = circle_stats(3)
print(f"Area = {round(a,2)}
Circumference = {round(c,2)}")
amazing video :)
TimeStamp:-
20:24
Precision upto x decimal places can be achieved by using
round(variable_name,x)
51:00
So, basically what I've understood,
"yield" is kind of like the "static" keyword which is used in c/c++.
when we say, "static int a = 5;" inside of a function & we call that function multiple times or call that function using a loop, that static variable "a" saves it's previous state in memory & performs the next tasks with it's previous state every single time function is called.
not saying they are the same. But yeah, i found it familiar.
19:45
Precision can be achieved using round() function as given below:
def circle_stats(radius):
area=math.pi*radius**2
circumference=2*math.pi*radius
return *round(area,2),round(circumference,2)*
print(circle_stats(5))
(78.54, 31.42)
*Further, can we round off multiple values at once instead of doing separately for each one?*
Solution of 20:26 :
print(“area:”,round(a,2),”circumference”,round(b,2))
Thanks buddy..........
Sir, apke help se hum sab to hopeful hain... Thanks Alot!
51:07 I have worked on some personal projects in deep learning and one use case of yield is handling huge amount of datasets where we need to fetch a batch of numbers from the datasets to perform calculation of gradients during backpropogation which is a way to optimized neural networks loss calculations
You are the best teacher,❤ in this platform,,
20:12
1) first method
Below formatted variable will be displayed with 5 decimal values
formatted = "{:.5f}".format(9.999875698989)
print(formatted) # output : 9.99988
And suppose we write like this
formatted = "{:.3f}".format(9.999875698989)
print(formatted) # output : 10
Then it will return 10 as output.
2) using round()
In this function we will pass two parameters, first is our value or variable and second is how many decimal values we want.
Example_1:
Number = 5.375829473
print(round(Number,2) # output : 5.36
Example_2 :
print(round(5.53627894,2)) # output : 5.53
Great! The format method was new to me.
Kudos to you, sir, for explaining yield in such a simplified manner, as if you were explaining it to a 5-years-old.
Thanks for such a simplistic, professional and in-depth content
for question 6(26:06), I used this:
cube = lambda user_in: user_in ** 3
user_in = float(input('Input a number for cube'))
print(cube(user_in))
my mind is just tuned with all your words, they just directly print into my mind i just simply run those without any errors , i think you have hacked my mind....grate full to u sir
thank you sir. I came to know about yeild for the first time. One application of args is in shoping cart.
Yr 900 views h fir bhi 400 comment kyu nhi hai😢 support kro yr sab chai aur code ko
Great video, yr 2 din se kuch smj nhi aa rha tha ise dekh k maza aa gya
Learning Python day 10 - present sir
00:03 Introduction to functions in Python
02:16 Learning functions in Python with confidence
06:06 Variables and function parameters in Python
08:07 Using the return keyword to output a result from a function in Python
12:05 Polymorphism in Python functions
14:17 Creating functions to return multiple values in Python
18:22 Returning multiple values from a function in Python
20:22 Creating and handling functions in Python.
24:13 Creating a function to compute the cube of a number
25:53 Understanding function definitions in Python
29:25 Using Python's special parameters to handle input values efficiently.
31:21 Printing and investigating errors in Python functions
34:53 Functions in Python and their usage with keyword arguments
36:52 Understanding function definitions and arguments in Python
40:42 Using formatting strings to print values in Python functions
42:33 Creating a function to generate even numbers with a limit in Python.
46:37 Understanding function implementation in Python
48:38 Functions in Python use yield to produce a sequence of values
52:16 Creating a function to calculate factorial and understanding recursion
54:18 Recursive approach to calculate factorial in Python
57:56 Learned the key concepts of functions in Python
20:11 import math
def circlestat(radius):
area = math.pi * radius **2
circumference = 2* math.pi *radius
return area ,circumference
a,b = circlestat(6)
a= round(a,3)
b=round(b,3)
print("area: ",a , "circumference",b)
round() is used to take those values upto 2 or 3 decimal places only
Super Guru ji.....Very insightful.....You are a great teacher Hitesh sir ji....keep up the great work......Respect from Bangalore...
this is my favorite youtube channel , nice teaching sir ji
The way he explained Yield keyword is beautiful !! LoveFromINDORE
Thank you for this video, never learned in this simplified way
really a good teaching technique sir
51:00 amazing explanation sir👏
reached functions!🥳 was left behind a few videos for a while, but covering it up!!!!🤧
Awesome lessons!!! Very well explained
20:10
import math
def circle_stats(radius):
area = math.pi * radius * radius
circumference = 2 * math.pi * radius
return area, circumference
a, c = circle_stats(3)
print(f"Area: {a:.3f}, Circumference: {c:.3f}")
Now I'm feeling that I'm diving into the internal working of python. The way he explains every topics that is phenomenal. I'm regularly waiting for his python series videos. Thanks sir for making this wonderful series.
thank you so much for teaching us in depth, lots of love from Jharkhand
❤ the way of teaching
Direct jump on hands on approach
the best channel to learn Python. need flask tutorial too Sir.
really loved this way of learning...
Every topic is explained very neatly and clearly.
Amazing content sir..❤..if you plan to make another lecture, plz dive in little more in Recursion and Yield concept .
Such in depth explanation is astonishing in free courses! 🙌
I love your teaching hitesh sir !!! I connect with you in coding
Awsome Guru ji.......Pls make more videos on python DSA focused on Data Science and Machine Learning........Respect from Bangalore...
We do use round method for getting precise values. e.g., round(number, 2) for getting precision upto 2 digits.
you explained very well, thank you sir
Sab mil kar appreciate kro yr sir ki dedication ko quality content ke liye..😊
I have never ever seen this kind of teaching 🙏,Thank you sir for you your efforts for us.
To avoid those recurring decimal in solution_04, we can use round() method to avoid those recurring decimals and can convert it to 1 , 2 or any decimal place you like.
Source Code:
import math
def circle_stats(radius):
area = round(math.pi * radius ** 2,2)
circumference = round(2 * math.pi * radius,2)
return area, circumference
a , c = circle_stats(3)
print("Area: ", a, "Circumference: ", c)
import math
def circle(radius):
area = round(math.pi*(radius**2),2)
circumference = round((2 * math.pi * radius) ,2);
return area , circumference;
r = int(input("Enter Radius: "))
a , c = circle(r)
print("The Area is: ",a)
print("The Circumference is: ",c)
in your code you are not defined how many precision after point like 2,3or 4
Now "yield" is very clear to me ❤
awesome really a good practice adapt to teach
We can use the f-strings functionality. For example, if we want precision up-to 2 digits, then we can type: -
print(f"Area : {a:.2f} Circumference: {c:.2f}")
Loved it!!!! Thank you so muchhh💞
Exited for the series that will based on python, Please start with Django if possible, It will be next level in your style and explanation in depth ♥
yup. django from his side will be amazing
def sums(*arg):
total =0
for i in arg:
total+=i
print(total)
sums(1200.50,
340.75,
560.00,
980.25,
2150.00)
Good way of teaching 👍
sir aapko killvish ko bhi add karna chahiye tha main villan ki tor pe
wese is tarike se python ke function ko sikh kar ke maza hi aa gaya
love from mumbai sir ji ❤❤
Thank you Sir, You really made thing so easy to understand.
def square(a):
print(a*a)
a =int(input("enter the number:"))
square(a)
Best Video Ever on Functions
Very nice explanation of function concept
very nice recursive problem solving approch
very helpful video for a new learner!
Very nicely explaining sir...
amazing way of teaching functions
Perfect Teaching 👌
This series YIELDS in depth knowledge.😁😁
Excellent tutorial.
Thank you so much sir , we really love this series also. ❤❤
y =lambda x:x**3
x = float(input("enter the number:"))
print(y(x))
Thank you so much sir for ❤ I love your way to teach and enjoying ever vedio of Chay and code .thank you❤
Very insightful contents Sir
Sir whatever you will to teach I'll learn all of it
Thankyou so much sir for scenario teaching ❤
Thank you sir for building this things easily
Thank you sir cover the function topics
def area_circumference(a):
area = (3.14)*(a)*(a)
circumference =2*3.14*(a)
print("area=",area)
print("circumference=",circumference)
a = float(input("enter the radius:"))
(area_circumference(a))
Love this way of solving problem learning ❤
"This series is a hidden treasure for programmers."
Explanation of Recursive function with pen & diagram sir 😊
Nice video for learners 👏👍
def radius(r):
area = 3.14* r*r
circumference = 2*3.14*r
return area, circumference
area, circumference = radius(5)
formatted = "{:.3f}".format(area)
formatted = "{:.3f}".format(circumference)
print(formatted)
# print(radius(5))
yield and recursion are really interesting
This is something you will never get for free. Best series for python !!
Thanks sir! Great work
thank you for adding project at the end 🙌🙌
Problem 4:
import math
def calc_circle(radius):
area = math.pi * radius ** 2
circumference = 2 * math.pi * radius
return area, circumference
a, c = calc_circle(3)
print("Area: ", round(a, 2), "Circumference: ", round(c, 2))
import math
def circle_calculate(radius):
area = math.pi *radius**2
circumference = 2 * math.pi * radius
return area, circumference
a,c = circle_calculate(3)
print("Area:",round(a,2), "Circumference:",round(c,2))
Great content...nice explanation
Nice bro, extremely good yield is best
Better than a paid course 💯
Amazing explanation sir ❤
This course is helpful ❤
Could you please consider launching a new series on core advanced Java? Topics like concurrency, JVM internals, and performance optimization would be really helpful.
Looking forward to more great content from you!
THANK YOU SIR FOR THIS AMAZING SERIES 🥳🥳
Thank you so much for deep explanation it is very helpful sir
bahut achha lagta h sir ap se sikhane me
05) USER INPUT
def greet(name="USER"):
return "HELLO ," + name + " !"
n1 = str(input("ENTER YOUR NAME : "))
if len(n1) >0:
print(greet(n1))
else:
print(greet())
Thanks sir for your efforts❤
Best python tutorial ever
import math
def circle_stats(radius):
circle = math.pi * radius ** 2
circumference = 2 * math.pi * radius
return round(circle,2), round(circumference,2)
radius = int(input("Enter radius: "))
circle, circumference = circle_stats(radius)
print("Area: ",circle ,"&" , "Circumference: ",circumference)
Nice sir your videos are very helpful love from Pakistan
Loving These Pytho_Series❤
Sir,For the question no.3
When two inputs are taken from the user like one is int and other is string types without direct passing as an argument then what will be happend ??
def greet(name):
if name == "":
print("hello world")
else:
print("hello",name)
name=input("enter the name:")
greet(name )
19:51
print(f"Area: {a:.2f}
Circumference: {round(c,2)}")