Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "/Users/shaunrogers/Desktop/Plymstock Prep/GCSE CS/SOL/Controlled Assessment/Sample Papers Solutions/gardening Task 2.py", line 105, in <module>
- lawn = m2_items("lawn",0)
- File "/Users/shaunrogers/Desktop/Plymstock Prep/GCSE CS/SOL/Controlled Assessment/Sample Papers Solutions/gardening Task 2.py", line 23, in m2_items
- minutes = area*time[index]
- TypeError: 'float' object is not subscriptable
- def m2_items (item,index):
- global costs, time, LABOUR
- length = int(input("How long is the "+ item+"?n"))
- width = int(input("How wide is the "+item+"?n"))
- area = length*width
- cost_m2 = float(costs[index])
- total_cost = area*cost_m2
- minutes = area*time[index]
- hours = int(minutes/60)
- labour = LABOUR*hours
- labour_cost=round(labour,2)
- m2_details = [area, cost_m2, total_cost,hours, labour_cost]
- return m2_details
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement