Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import sleep
- import random
- # Haiku function
- def haiku():
- haiku_quote = ["Snow in my shoe", "Abandoned", "Sparrow's nest"]
- for item in haiku_quote:
- sleep(1)
- print(item)
- haiku()
- # Calculate area of triangle function
- def cal_area():
- a = float(input("Enter the height of the triangle"))
- b = float(input("Enter the base of the triangle"))
- area = (float(a) * float(b)) / 2
- print(area)
- cal_area()
- # Coin flip function
- def coin_flip():
- coin = random.randint(1,2)
- if (coin == 1):
- print("Heads")
- else:
- print("Tails")
- coin_flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement