Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define the haiku funtion
- def haiku():
- from time import sleep
- print(haiku_line1)
- sleep(2)
- print(haiku_line2)
- sleep(2)
- print(haiku_line3)
- haiku_line1 = "Relax, the future"
- haiku_line2 = "is already unfolding"
- haiku_line3 = "from long-planted seeds"
- haiku()
- #define the triangle function, to calculate the surface area
- def triangle():
- base = input("Enter the base measurement of the triangle in cm ")
- height = input("Enter the height measurement of the triangle in cm ")
- surface = 0.5 * int(base) * int(height)
- print(str(surface) + " cm3 ")
- triangle()
- #define the coin flip function, it must ramdonly generate an outcome
- def coin_flip():
- import random
- print("Lets flip a coin")
- option = ["Heads", "Tails"]
- result = random.choice(option)
- print("The result is " + result)
- coin_flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement