Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. def triangle_dem(): #finds the area of a triangle
  2. height = input('What is the height of your triangle? ')
  3. base = input('Great. Now what is the base of your triangle? ')
  4. base = int(base)
  5. height = int(height)
  6. area = base * height / 2
  7. area = str(area)
  8. print('The area of your triangle is ' + area + '.')
  9.  
  10. def haiku_creator(): #prints a haiku created by the user
  11. from time import sleep
  12. line1 = input('What is the first line of your haiku? ')
  13. line2 = input('Okay. Now what is the second line of your haiku? ')
  14. line3 = input('Now provide the last line of your haiku. ')
  15. sleep(1)
  16. print('Fantastic. Here is your haiku!')
  17. sleep(2)
  18. print(line1)
  19. sleep(2)
  20. print(line2)
  21. sleep(2)
  22. print(line3)
  23.  
  24. def coin_toss():
  25. import random
  26. coin_sides = ['dog','cat','snail']
  27. print(random.choice(coin_sides))
  28.  
  29. coin_toss()
  30. haiku_creator()
  31. triangle_dem()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement