In this video we brought our unit converter a step closer to the one found in Google Search, in that we’re now able to convert from any length dimension to any other length dimension
To do this:
We require from the user three inputs:
Value to be converted
Unit to convert from
Unit to convert to
Based on the last two inputs, we create an elaborate dictionary with all possible length conversions. The keys in this dictionary follow the pattern from_unit-to_unit
Once our dictionary and inputs are set up, our application is then ready to go.
As a final touch we added an if condition that prints the converted value if the user inputs the right info. However should the user input any incorrect data,the app would then state that he’s made an error in his inputs.
The code of this iteration is upload on GitHub:
https://github.com/zaittworks/baselin...
#python #beginner #app
On this page of the site you can watch the video online Working Units Converter in Python for Length | Learn Python From Scratch 7 | Kovolff with a duration of hours minute second in good quality, which was uploaded by the user kovolff 03 November 2020, share the link with friends and acquaintances, this video has already been watched 523 times on youtube and it was liked by 9 viewers. Enjoy your viewing!