MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / perform_conversion

Function perform_conversion

Converter/converter.py:27–31  ·  view source on GitHub ↗

Perform unit conversion.

(res)

Source from the content-addressed store, hash-verified

25 print(options[command])
26
27def perform_conversion(res):
28 """Perform unit conversion."""
29 for i in res[3].split(','):
30 value = round(eval("{} * {}['{}'] / {}['{}']".format(res[2], res[0], i, res[0], res[1])), 6) # calculating
31 print("{} \t : {}".format(i, value)) # displaying
32
33if __name__ == "__main__":
34 main()

Callers 1

mainFunction · 0.85

Calls 2

splitMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected