Skip to content

Commit 26a36c8

Browse files
committed
Chapter 2
1 parent 85fa90b commit 26a36c8

17 files changed

+37
-6
lines changed
22 KB
Loading

chapter2/solutions/expenditures_barchart.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def create_bar_chart(data, labels):
2020
plt.title('Weekly expenditures')
2121
# Turns on the grid which may assist in visual estimation
2222
plt.grid()
23-
plt.show()
23+
#plt.show()
24+
plt.savefig('expenditures_barchar.png')
2425

2526
if __name__ == '__main__':
2627
n = int(input('Enter the number of categories: '))
23.1 KB
Loading

chapter2/solutions/fibonacci_goldenratio.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def plot_ratio(series):
3232
plt.title('Ratio between Fibonacci numbers & Golden ratio')
3333
plt.ylabel('Ratio')
3434
plt.xlabel('No.')
35-
plt.show()
35+
#plt.show()
36+
plt.savefig('fibonacci_goldenratio.png')
3637

3738
if __name__ == '__main__':
3839
# Number of fibonacci numbers
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
3
2+
Phone
3+
20
4+
Food
5+
50
6+
Travel
7+
30

chapter2/solutions/inputs/fibonacci_goldenratio.input

Whitespace-only changes.

chapter2/solutions/inputs/nyc_forecast_basic.input

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
3
2+
25
3+
60
4+
30
5+
60
6+
70
7+
40

chapter2/solutions/inputs/quad_function_plot.input

Whitespace-only changes.
24.3 KB
Loading

0 commit comments

Comments
 (0)