The secret of Average in Python

Finding an average value in Python is a simple activity that every beginner should know. Defining the values with their respective variables helps understand most applications in this process.

Given that, 55, 78, 87 and 25, in this aspect, we automatically assign the variables such as a,b,c, and d.

 

Activity:

def calculate_average(a, b, c, d);

          average = ( a + b + c + d / 4)

                    return average

# Test the unction

                                a   =   54

                                b   =   78

                                c   =   87

                               d   =   25

result = calculate_average ( a, b, c, d )

print("The average is:",result)

 

Great Job Done!!!

About Author


Discover more from SURFCLOUD TECHNOLOGY

Subscribe to get the latest posts sent to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *

Discover more from SURFCLOUD TECHNOLOGY

Subscribe now to keep reading and get access to the full archive.

Continue reading