Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def triangle_dem(): #finds the area of a triangle
- height = input('What is the height of your triangle? ')
- base = input('Great. Now what is the base of your triangle? ')
- base = int(base)
- height = int(height)
- area = base * height / 2
- area = str(area)
- print('The area of your triangle is ' + area + '.')
- def haiku_creator(): #prints a haiku created by the user
- from time import sleep
- line1 = input('What is the first line of your haiku? ')
- line2 = input('Okay. Now what is the second line of your haiku? ')
- line3 = input('Now provide the last line of your haiku. ')
- sleep(1)
- print('Fantastic. Here is your haiku!')
- sleep(2)
- print(line1)
- sleep(2)
- print(line2)
- sleep(2)
- print(line3)
- def coin_toss():
- import random
- coin_sides = ['dog','cat','snail']
- print(random.choice(coin_sides))
- coin_toss()
- haiku_creator()
- triangle_dem()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement