From adfd824c3c694e6b3791ac52234a3c0c01f094a0 Mon Sep 17 00:00:00 2001 From: avosa Date: Sun, 13 Dec 2020 23:44:56 +0300 Subject: [PATCH] Added weight converter example --- weightConverterExample.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 weightConverterExample.py diff --git a/weightConverterExample.py b/weightConverterExample.py new file mode 100644 index 0000000..46ec17e --- /dev/null +++ b/weightConverterExample.py @@ -0,0 +1,8 @@ +weight = float(input("Enter weight: ")) +unit = input("Is it in (K)g or (L)bs?: ") +if unit.upper() == "K": + converted = weight / 0.45 + print ("Weight in Lbs: " + str(converted)) +else: + converted = weight * 0.45 + print ("Weight in Kg: " + str(converted)) \ No newline at end of file