From f0d7739bd9cc64c605d7da333637e06bb7f8b512 Mon Sep 17 00:00:00 2001 From: Colcothar <33038729+Colcothar@users.noreply.github.com> Date: Mon, 23 Oct 2017 20:39:17 +0100 Subject: [PATCH] Added Function Added function for future use --- Day_1/Assignment01.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Day_1/Assignment01.py b/Day_1/Assignment01.py index d277365..42488d6 100644 --- a/Day_1/Assignment01.py +++ b/Day_1/Assignment01.py @@ -1,6 +1,9 @@ - -gallon = input ("Please enter the number of gallons of gasoline : ") -gallon=float(gallon) +def process(): + gallon = input ("Please enter the number of gallons of gasoline : ") + gallon=float(gallon) + return gallon +gallon = process() + print ("Original number of gallons is : " , gallon) print (gallon , " gallons is equvivalent of " , gallon*3.7854 , "litres") print (gallon , " gallons of gasoline requires " , gallon/19.5 , "barrels of oil")