Program to Convert Km / hr to miles / hr and vice versa | Function to convert kmph to mph ; Function to convert mph to kmph ;
def kmphTOmph ( kmph ) : NEW_LINE INDENT mph = 0.6214 * kmph NEW_LINE return mph NEW_LINE DEDENT def mphTOkmph ( mph ) : NEW_LINE INDENT kmph = ( float ) ( mph * 1.60934 ) NEW_LINE return kmph NEW_LINE DEDENT / * Driver code to check the above function * / NEW_LINE kmph = 150 NEW_LINE mph = 100 NEW_LINE print " speed ▁ in ▁ miles ▁ / ▁ hr ▁ is ▁ " , kmphTOmph ( kmph ) NEW_LINE print " speed ▁ in ▁ km ▁ / ▁ hr ▁ is ▁ " , mphTOkmph ( mph ) NEW_LINE