We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14154fb commit 1d2cea1Copy full SHA for 1d2cea1
Simple Functions/Washing_Machine.py
@@ -0,0 +1,17 @@
1
+# say you wanted to make a washing machine calculator that would return you the amount of water required to wash some clothes if you
2
+# knew that every extra unit required 10% more water:
3
+
4
+def how_much_water(water, clothes, load):
5
+ if load > 2 * clothes:
6
+ return "Too much clothes"
7
8
+ if load < clothes:
9
+ return "Not enough clothes"
10
11
+ for i in range(load - clothes):
12
+ water *= 1.1
13
14
+ return round(water, 2)
15
16
+def how_much_water(l, x, n):
17
+ return "Too much clothes" if n > 2*x else "Not enough clothes" if n < x else round(1.1**(n-x)*l, 2)
0 commit comments