Fixed Lint Formatting

This commit is contained in:
Metropass
2020-10-19 16:04:53 -04:00
parent 429ea62518
commit d19d1de443
2 changed files with 7 additions and 7 deletions

View File

@@ -1,8 +1,8 @@
from .__init__ import * from .__init__ import *
#converts decimal into octal
def decimalToOctalFunc(maxDecimal = 4096): def decimalToOctalFunc(maxDecimal=4096):
x = random.randint(0, maxDecimal) x = random.randint(0, maxDecimal)
problem = "The decimal number " + str(x) + " in Octal is: " problem = "The decimal number " + str(x) + " in Octal is: "
solution = oct(x) solution = oct(x)

View File

@@ -1,22 +1,22 @@
from .__init__ import * from .__init__ import *
#converts decimal to roman numerals
def decimalToRomanNumeralsFunc(maxDecimal = 4000): def decimalToRomanNumeralsFunc(maxDecimal=4000):
x = random.randint(0, maxDecimal) x = random.randint(0, maxDecimal)
problem = "The number " + str(x) + " in Roman Numerals is: " problem = "The number " + str(x) + " in Roman Numerals is: "
roman_dict = {1:"I", 5:"V", 10: "X", 50:"L", 100:"C", 500:"D", 1000: "M"} roman_dict = {1: "I", 5: "V", 10: "X", 50: "L", 100: "C", 500: "D", 1000: "M"}
divisor = 1 divisor = 1
while x >= divisor: while x >= divisor:
divisor *= 10 divisor *= 10
divisor /= 10 divisor /= 10
solution = "" solution = ""
while x: while x:
last_value = int(x/divisor) last_value = int(x / divisor)
if last_value <= 3: if last_value <= 3:
solution += (roman_dict[divisor] * last_value) solution += (roman_dict[divisor] * last_value)
elif last_value == 4: elif last_value == 4:
solution += (roman_dict[divisor] * roman_dict[divisor*5]) solution += (roman_dict[divisor] * roman_dict[divisor * 5])
elif 5 <= last_value <= 8: elif 5 <= last_value <= 8:
solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5))) solution += (roman_dict[divisor * 5] + (roman_dict[divisor] * (last_value - 5)))
elif last_value == 9: elif last_value == 9: