Solve 10 problems on functions in python

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 455

  • @justtt.prerna
    @justtt.prerna 8 месяцев назад +19

    I know some basics of python but whenever I watch your videos , I consistently gain new insights and knowledge.

    • @TooniMe
      @TooniMe 7 месяцев назад +1

      But your code shows errors lol

  • @zakirdev
    @zakirdev 7 месяцев назад +3

    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. ❤❤

  • @hellohere-pu8uj
    @hellohere-pu8uj 4 месяца назад +12

    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)}")

  • @shikharpandya4927
    @shikharpandya4927 7 месяцев назад +3

    amazing video :)
    TimeStamp:-
    20:24
    Precision upto x decimal places can be achieved by using
    round(variable_name,x)

  • @SadmanSakib2001
    @SadmanSakib2001 8 месяцев назад +8

    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.

  • @epslearns
    @epslearns 7 месяцев назад +4

    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?*

  • @softNandan
    @softNandan 8 месяцев назад +7

    Solution of 20:26 :
    print(“area:”,round(a,2),”circumference”,round(b,2))

  • @sheikhabdullah8298
    @sheikhabdullah8298 8 месяцев назад +2

    Sir, apke help se hum sab to hopeful hain... Thanks Alot!

  • @dakshbhatnagar
    @dakshbhatnagar 8 месяцев назад +2

    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

  • @Barunghorai-pn4vy
    @Barunghorai-pn4vy 6 месяцев назад +1

    You are the best teacher,❤ in this platform,,

  • @priya_chauhan1258
    @priya_chauhan1258 7 месяцев назад +11

    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

    • @aditya536
      @aditya536 3 месяца назад

      Great! The format method was new to me.

  • @pranaypaul6361
    @pranaypaul6361 8 месяцев назад +1

    Kudos to you, sir, for explaining yield in such a simplified manner, as if you were explaining it to a 5-years-old.

  • @shreyanshmalewar1208
    @shreyanshmalewar1208 Месяц назад

    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))

  • @ABDULSAMI-z1k
    @ABDULSAMI-z1k 2 месяца назад

    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

  • @atharvatirkhunde4517
    @atharvatirkhunde4517 7 месяцев назад +2

    thank you sir. I came to know about yeild for the first time. One application of args is in shoping cart.

  • @anuraggupta1008
    @anuraggupta1008 8 месяцев назад +11

    Yr 900 views h fir bhi 400 comment kyu nhi hai😢 support kro yr sab chai aur code ko

  • @iam_vijay.21
    @iam_vijay.21 Месяц назад

    Great video, yr 2 din se kuch smj nhi aa rha tha ise dekh k maza aa gya

  • @swarnabhamajumder9561
    @swarnabhamajumder9561 8 месяцев назад +2

    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

  • @predator1999
    @predator1999 9 дней назад

    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

  • @shaikusman536
    @shaikusman536 5 месяцев назад

    Super Guru ji.....Very insightful.....You are a great teacher Hitesh sir ji....keep up the great work......Respect from Bangalore...

  • @virendrthakur7865
    @virendrthakur7865 4 месяца назад

    this is my favorite youtube channel , nice teaching sir ji

  • @countryno446
    @countryno446 3 месяца назад

    The way he explained Yield keyword is beautiful !! LoveFromINDORE

  • @gopalpatil86
    @gopalpatil86 14 дней назад

    Thank you for this video, never learned in this simplified way

  • @mahipalsingh-pc4mo
    @mahipalsingh-pc4mo 6 месяцев назад +1

    really a good teaching technique sir

  • @priyankagehlot9945
    @priyankagehlot9945 2 месяца назад

    51:00 amazing explanation sir👏

  • @winter_1306
    @winter_1306 8 месяцев назад +1

    reached functions!🥳 was left behind a few videos for a while, but covering it up!!!!🤧

  • @saunLogan
    @saunLogan 22 дня назад

    Awesome lessons!!! Very well explained

  • @umairansari5392
    @umairansari5392 2 месяца назад +1

    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}")

  • @prabhatthakur8730
    @prabhatthakur8730 8 месяцев назад

    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.

  • @umeshkr9316
    @umeshkr9316 5 месяцев назад

    thank you so much for teaching us in depth, lots of love from Jharkhand

  • @kishandata23
    @kishandata23 8 месяцев назад

    ❤ the way of teaching
    Direct jump on hands on approach

  • @Entertainment-xu1qc
    @Entertainment-xu1qc 8 месяцев назад

    the best channel to learn Python. need flask tutorial too Sir.

  • @subratkumarnayak2560
    @subratkumarnayak2560 3 месяца назад

    really loved this way of learning...

  • @MDFAIZANSARI
    @MDFAIZANSARI 7 месяцев назад

    Every topic is explained very neatly and clearly.

  • @sidharthkashyap6241
    @sidharthkashyap6241 8 месяцев назад +1

    Amazing content sir..❤..if you plan to make another lecture, plz dive in little more in Recursion and Yield concept .

  • @abhirajsinha23
    @abhirajsinha23 7 месяцев назад

    Such in depth explanation is astonishing in free courses! 🙌

  • @samarthkhakhkhar6703
    @samarthkhakhkhar6703 7 месяцев назад

    I love your teaching hitesh sir !!! I connect with you in coding

  • @shaikusman536
    @shaikusman536 5 месяцев назад

    Awsome Guru ji.......Pls make more videos on python DSA focused on Data Science and Machine Learning........Respect from Bangalore...

  • @ashishkumarbhagwani6931
    @ashishkumarbhagwani6931 4 месяца назад +1

    We do use round method for getting precise values. e.g., round(number, 2) for getting precision upto 2 digits.

  • @meenakshimeeen
    @meenakshimeeen Месяц назад

    you explained very well, thank you sir

  • @anuraggupta1008
    @anuraggupta1008 8 месяцев назад

    Sab mil kar appreciate kro yr sir ki dedication ko quality content ke liye..😊

  • @umar155
    @umar155 3 месяца назад

    I have never ever seen this kind of teaching 🙏,Thank you sir for you your efforts for us.

  • @muhammadhilal5807
    @muhammadhilal5807 7 месяцев назад +4

    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)

    • @SamiButt-bc2xh
      @SamiButt-bc2xh 4 месяца назад

      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)

    • @SamiButt-bc2xh
      @SamiButt-bc2xh 4 месяца назад

      in your code you are not defined how many precision after point like 2,3or 4

  • @tuhinghosh9737
    @tuhinghosh9737 8 месяцев назад

    Now "yield" is very clear to me ❤

  • @faisaliqbal-h2k
    @faisaliqbal-h2k 2 месяца назад

    awesome really a good practice adapt to teach

  • @viditvats5733
    @viditvats5733 7 месяцев назад

    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}")

  • @adityapratapsingh7140
    @adityapratapsingh7140 2 месяца назад

    Loved it!!!! Thank you so muchhh💞

  • @KaushalLakhani-b2g
    @KaushalLakhani-b2g 8 месяцев назад +2

    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 ♥

    • @afzalhamdulay
      @afzalhamdulay 8 месяцев назад +1

      yup. django from his side will be amazing

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 2 месяца назад

    def sums(*arg):
    total =0
    for i in arg:
    total+=i
    print(total)
    sums(1200.50,
    340.75,
    560.00,
    980.25,
    2150.00)

  • @iamprogrammer5054
    @iamprogrammer5054 Месяц назад

    Good way of teaching 👍

  • @vishalkandu1031
    @vishalkandu1031 8 месяцев назад

    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 ❤❤

  • @ShivamMishra-ut1cd
    @ShivamMishra-ut1cd 4 месяца назад

    Thank you Sir, You really made thing so easy to understand.

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 2 месяца назад

    def square(a):
    print(a*a)
    a =int(input("enter the number:"))
    square(a)

  • @UpendraYadav-gc3bd
    @UpendraYadav-gc3bd 8 месяцев назад

    Best Video Ever on Functions

  • @ruhi4633
    @ruhi4633 2 месяца назад

    Very nice explanation of function concept

  • @vishalrathore7052
    @vishalrathore7052 6 месяцев назад +1

    very nice recursive problem solving approch

  • @ishatiwari3023
    @ishatiwari3023 5 месяцев назад

    very helpful video for a new learner!

  • @hemantkumardas3333
    @hemantkumardas3333 8 месяцев назад

    Very nicely explaining sir...

  • @sidhantarya2483
    @sidhantarya2483 8 месяцев назад

    amazing way of teaching functions

  • @sufiyanpatel6241
    @sufiyanpatel6241 2 месяца назад

    Perfect Teaching 👌

  • @gautamraj8114
    @gautamraj8114 8 месяцев назад +1

    This series YIELDS in depth knowledge.😁😁

  • @pralaysankarchowdhury
    @pralaysankarchowdhury 26 дней назад

    Excellent tutorial.

  • @shivkumarpatel8464
    @shivkumarpatel8464 8 месяцев назад

    Thank you so much sir , we really love this series also. ❤❤

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 2 месяца назад

    y =lambda x:x**3
    x = float(input("enter the number:"))
    print(y(x))

  • @khushivyas970
    @khushivyas970 6 месяцев назад

    Thank you so much sir for ❤ I love your way to teach and enjoying ever vedio of Chay and code .thank you❤

  • @ArjunSharma-yk5xf
    @ArjunSharma-yk5xf 4 месяца назад

    Very insightful contents Sir

  • @VARUNVERMABCE
    @VARUNVERMABCE 8 месяцев назад

    Sir whatever you will to teach I'll learn all of it

  • @himanshkataria6508
    @himanshkataria6508 5 месяцев назад

    Thankyou so much sir for scenario teaching ❤

  • @hetashrikansariwala9527
    @hetashrikansariwala9527 8 месяцев назад

    Thank you sir for building this things easily

  • @KHUSHBOOPRAJAPATI-me6yj
    @KHUSHBOOPRAJAPATI-me6yj 3 месяца назад

    Thank you sir cover the function topics

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 2 месяца назад

    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))

  • @kumargupta7149
    @kumargupta7149 8 месяцев назад

    Love this way of solving problem learning ❤

  • @yashrahadve
    @yashrahadve 6 месяцев назад +1

    "This series is a hidden treasure for programmers."

  • @vandanapatil8182
    @vandanapatil8182 8 месяцев назад

    Explanation of Recursive function with pen & diagram sir 😊

  • @mohitnemade5320
    @mohitnemade5320 4 месяца назад

    Nice video for learners 👏👍

  • @Airman.programer
    @Airman.programer 2 месяца назад

    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))

  • @hyperintelligentmanoj2189
    @hyperintelligentmanoj2189 2 месяца назад

    yield and recursion are really interesting

  • @akshaykudale4762
    @akshaykudale4762 4 месяца назад

    This is something you will never get for free. Best series for python !!

  • @mohdsuhail2470
    @mohdsuhail2470 5 месяцев назад

    Thanks sir! Great work

  • @arnabpal5407
    @arnabpal5407 7 месяцев назад

    thank you for adding project at the end 🙌🙌

  • @yashchhatrala9207
    @yashchhatrala9207 3 месяца назад

    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))

  • @risingaw1163
    @risingaw1163 6 месяцев назад

    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))

  • @khulvemeenakshi
    @khulvemeenakshi 5 месяцев назад

    Great content...nice explanation

  • @bharatsinhparmar3666
    @bharatsinhparmar3666 7 месяцев назад

    Nice bro, extremely good yield is best

  • @sahilsaini9976
    @sahilsaini9976 7 дней назад

    Better than a paid course 💯

  • @deepakkgupta
    @deepakkgupta 8 месяцев назад

    Amazing explanation sir ❤

  • @not_amanullah
    @not_amanullah 7 месяцев назад

    This course is helpful ❤

  • @M-ShivamMole
    @M-ShivamMole 3 месяца назад

    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!

  • @decoder_pankaj
    @decoder_pankaj 2 месяца назад

    THANK YOU SIR FOR THIS AMAZING SERIES 🥳🥳

  • @anujmishra3683
    @anujmishra3683 8 месяцев назад

    Thank you so much for deep explanation it is very helpful sir

  • @surajupadhyay1957
    @surajupadhyay1957 7 месяцев назад

    bahut achha lagta h sir ap se sikhane me

  • @ffstriker8102
    @ffstriker8102 3 месяца назад

    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())

  • @blackpantherrr2030
    @blackpantherrr2030 2 месяца назад

    Thanks sir for your efforts❤

  • @rushikeshmodi4870
    @rushikeshmodi4870 5 месяцев назад

    Best python tutorial ever

  • @NeelVaria-ji3nx
    @NeelVaria-ji3nx 2 месяца назад

    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)

  • @abdulhafeez639
    @abdulhafeez639 17 дней назад

    Nice sir your videos are very helpful love from Pakistan

  • @arjunbhandari1672
    @arjunbhandari1672 4 месяца назад

    Loving These Pytho_Series❤

  • @Barunghorai-pn4vy
    @Barunghorai-pn4vy 6 месяцев назад

    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 ??

  • @dsairaghavsumanth6756
    @dsairaghavsumanth6756 2 месяца назад

    def greet(name):
    if name == "":
    print("hello world")
    else:
    print("hello",name)
    name=input("enter the name:")
    greet(name )

  • @mr.darksyt786
    @mr.darksyt786 2 месяца назад

    19:51
    print(f"Area: {a:.2f}
    Circumference: {round(c,2)}")