Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def triangle_area():
- print("Calculates the area of a triangle")
- height = input("Height of the triangle?")
- base = input("Length of the base of the triangle?")
- area = (int(base) * int(height))/2
- print ("The area is ", area, " m^2")
- def coin_flip():
- if random.randint(0,1)==0:
- coin="heads"
- else:
- coin="tails"
- print (" The coin has fallen showing ", coin)
- triangle_area()
- coin_flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement