-
Notifications
You must be signed in to change notification settings - Fork 3
/
acre_script.py
46 lines (35 loc) · 1.47 KB
/
acre_script.py
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
38
39
40
41
42
43
44
45
46
"""
For longer comments, put them inside triple quotes.
Everything inside the triple quotes will be ignored.
MAIN COMMENT
The main comment should explain what the script does and give
any information that someone would need to run the script,
such as what type of files are required (if any).
For this script:
This script converts a list of square foot measurements to acres.
To run the script:
This script can be run from the command line. This file does
not need to be open to run the script on the command line.
Run the script on the command line by navigating to the
folder that contains this script and
typing python acre_script.py.
"""
#IMPORT MODULES
#if you have any modules to import, import them at the top of the script,
#under the comments, so that anyone using this script can quickly
#know which modules are required - they might need to install them
#HARD-CODED VARIABLES
#assign any variables, including filenames, here, so that if you want to
#run the script with different data, it's easy to see and change
test_list = [5000, 6500, 8000, 15251]
#FUNCTION DEFINITIONS
#include any function definitions here
def sqft_to_acres(sqft):
#this function takes square footage and returns rounded acreage
acres = sqft / 43560
return round(acres, 2)
#BODY OF CODE
#the rest of your code, including any function calls, goes here
for test_value in test_list:
answer = sqft_to_acres(test_value)
print(str(test_value) + " square feet is " + str(answer) + " acres.")