Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python – Super simple KG to LBS conveter

just got into python, any advice why these simple lines sends me an error?

# ---------------- WEIGHT CONVERTER ----------------#

_userWeight = input("Weight [KG]: ")
_userLbs = int(_userWeight) * 2.2
print(int(_userWeight) + "[KG] = " + int(_userLbs) + "[lbs]")

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  _userWeight = input("Weight [KG]: ")
  _userLbs = int(_userWeight) * 2.2 
  print(int(_userWeight) , "[KG] = " , int(_userLbs) , "[lbs]")

Remove the ‘+’ and use a ‘,’

Output:

Weight [KG]: 50

50 [KG] = 110 [lbs]

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading