From cdbf30eeb3d17b04d76f209a551c95d77d80c7f6 Mon Sep 17 00:00:00 2001 From: Spy <32415621+SpyHoodle@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:40:37 +0100 Subject: [PATCH] add more comments --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 615d0d5..9ca250b 100644 --- a/main.py +++ b/main.py @@ -55,16 +55,19 @@ def calc_resistor(colours, bands): tolerance = 0 for i, colour in enumerate(colours): - # Get the band + # Get the band value from if i < 3: bands_value += str(bands[colour]["band"]) + # Get the multiplier elif i == 3: multiplier = bands[colour]["multiplier"] + # Get the tolerance elif i == 4: tolerance = bands[colour]["tolerance"] + # Calculate the resistor value resistor_value = int(bands_value) * multiplier return resistor_value, tolerance