Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Created on Wed Sep 19 14:19:16 2018
- @author: sam
- """
- # create a function to calculate the area of a triangle
- def calculateTriangle( base, height ):
- # the operation multiplies 1/2 by base and then multiplies the result by height
- area = (1/2) * base * height
- return area;
- # assign the value 12 to the variable base_input
- base_input = 12
- # assign the value 16 to the variable height_input
- height_input = 16
- # assign the result of the operation to the variable area_output
- area_output = calculateTriangle(base_input,height_input)
- # print the value of area_output
- print(area_output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement