Skip to content

Commit ec3aac3

Browse files
authored
Create sears.py
1 parent 69f0c9f commit ec3aac3

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎Work/sears.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# sears.py
2+
# Which line is the error? 14
3+
# What is the error? days is not defined
4+
# Fix the error
5+
# Run the program successfully
6+
7+
bill_thickness = 0.11 * 0.001 # Meters (0.11 mm)
8+
sears_height = 442 # Height (meters)
9+
num_bills = 1
10+
day = 1
11+
12+
while num_bills * bill_thickness < sears_height:
13+
print(day, num_bills, num_bills * bill_thickness)
14+
day = day +1 # day = days + 1 # error happening here
15+
num_bills = num_bills * 2
16+
17+
print('Number of days', day)
18+
print('Number of bills', num_bills)
19+
print('Final height', num_bills * bill_thickness)

0 commit comments

Comments
 (0)