From 1b94922df5a9771daf83bb98ed4119267c8fdc7f Mon Sep 17 00:00:00 2001 From: harsh mendhe Date: Fri, 18 Sep 2026 22:04:10 +0530 Subject: [PATCH] Refactor currency input and calculation logic The logic of the program can be resolved according to this method also --- 2-variables/10_currency.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/2-variables/10_currency.py b/2-variables/10_currency.py index bb949a1..3e1aa75 100644 --- a/2-variables/10_currency.py +++ b/2-variables/10_currency.py @@ -1,10 +1,8 @@ -# Currency 💵 -# Codédex - -pesos = int(input('What do you have left in pesos? ')) -soles = int(input('What do you have left in soles? ')) -reais = int(input('What do you have left in reais? ')) - -total = pesos * 0.00025 + soles * 0.28 + reais * 0.21 - +print("How much do you have left in pesos?") +a1 = int(input(": ")) +print("How much do you have left in pesos?") +a2 = int(input(": ")) +print("How much do you have left in pesos?") +a3 = int(input(": ")) +total = a1 * 0.00025 + a2 * 0.28 + a3 * 0.21 print(total)