-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathp16.py
More file actions
132 lines (123 loc) · 2.76 KB
/
p16.py
File metadata and controls
132 lines (123 loc) · 2.76 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# p16.py
# Rishi Saravanan
# Python 3.11.9
# Description:
'''
Write a program which uses a while loop to display a conversion table, with kilograms on the left and pounds on the right. Pounds are rounded to 1 decimal digit.
1 kg = 2.2 lb
Include every other (odd) values of kilograms, from 1 to 199.
Kilograms Pounds
1 2.2
3 6.6
.... ......
197 433.4
199 437.8
'''
print("Kilograms Pounds")
for kilograms in range(1,201,2):
pounds = kilograms*2.2
print("%3i" %kilograms, " %.2f" %pounds)
'''
===================== RESTART: C:/Users/rishi/python/p16.py ====================
Kilograms Pounds
1 2.20
3 6.60
5 11.00
7 15.40
9 19.80
11 24.20
13 28.60
15 33.00
17 37.40
19 41.80
21 46.20
23 50.60
25 55.00
27 59.40
29 63.80
31 68.20
33 72.60
35 77.00
37 81.40
39 85.80
41 90.20
43 94.60
45 99.00
47 103.40
49 107.80
51 112.20
53 116.60
55 121.00
57 125.40
59 129.80
61 134.20
63 138.60
65 143.00
67 147.40
69 151.80
71 156.20
73 160.60
75 165.00
77 169.40
79 173.80
81 178.20
83 182.60
85 187.00
87 191.40
89 195.80
91 200.20
93 204.60
95 209.00
97 213.40
99 217.80
101 222.20
103 226.60
105 231.00
107 235.40
109 239.80
111 244.20
113 248.60
115 253.00
117 257.40
119 261.80
121 266.20
123 270.60
125 275.00
127 279.40
129 283.80
131 288.20
133 292.60
135 297.00
137 301.40
139 305.80
141 310.20
143 314.60
145 319.00
147 323.40
149 327.80
151 332.20
153 336.60
155 341.00
157 345.40
159 349.80
161 354.20
163 358.60
165 363.00
167 367.40
169 371.80
171 376.20
173 380.60
175 385.00
177 389.40
179 393.80
181 398.20
183 402.60
185 407.00
187 411.40
189 415.80
191 420.20
193 424.60
195 429.00
197 433.40
199 437.80
'''