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.
2 parents 8d20737 + 362658d commit 4e666b2Copy full SHA for 4e666b2
exercises/practice/resistor-color-trio/.meta/example.gd
@@ -13,6 +13,9 @@ func color_code(colors):
13
14
for key in units.keys():
15
if total >= key:
16
- return str(total / key) + " " + units[key]
+ return format_number(total / key) + " " + units[key]
17
18
- return str(total) + " ohms"
+ return format_number(total) + " ohms"
19
+
20
+func format_number(n):
21
+ return str(int(n)) if n == int(n) else str(n)
0 commit comments