-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommentExample.py
More file actions
37 lines (31 loc) · 1.08 KB
/
commentExample.py
File metadata and controls
37 lines (31 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# commentExample.py
# Purpose: This file is to provide an example of the quality
# and format of commenting on files. There will be a header
# at the top that contains a general description of the
# file purpose along with information about the author.
# Author: Troy Schotter
# Recieved Help From: Coffee
# calcAge(currentYear, yearBorn)
# parameters:
# currentYear: integer representing a specific year
# yearBorn: integer representing a specific year
# returns:
# x: a calculated integer that represents an estimated age
# purpose:
# This function takes a two years and calculates the age at
# at the end of the "currentYear", returning that integer value
def calcAge(currentYear, yearBorn):
x = currentYear - yearBorn
return x
# main()
# parameters: none
# return: none
# purpose:
# This extremely complex function runs when the program runs
# and acts as the starting point of the file.
# says "Hello World" and the age of Troy at the end of 2026.
def main():
print("Hello World")
print(f"I will be {calcAge(2026, 1989)} this year")
if __name__ == "__main__":
main()