Python Exercise 1

  —————– sample ———————– def hello(): “”” prints hello, world “”” print “Hello, world!” def areacircle(radius): “”” Computes the area of a circle of the given radius “”” area = 3.14*radius**2 print “The area of a circle of radius”,radius,”is”, area “”” Exercise: Write a function ‘def areatriangle(b,h)’ to compute the area of a triangle: formula … Continue reading Python Exercise 1