Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def hole():
  2.     par = int(input('What is the par for the hole?\t'))
  3.     strokes = int(input('How many strokes did you take?\t'))
  4.     return strokes - par
  5.  
  6. def main():
  7.     total_score = 0
  8.     while True:
  9.         hole_score = hole()
  10.         total_score += hole_score
  11.         print()
  12.         print('Your score for the hole is: {}'.format(hole_score))
  13.         print('Your total score is: {}'.format(total_score))
  14.  
  15. if __name__ == '__main__':
  16.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement