Question #47990

How do I write a program to produce output like the following:-

Cost of 1st item
Enter pounds > 1
Enter pence > 45

Cost input for 1st item is 1.45

Expert's answer

#!/usr/bin/env python3
print("Cost of 1st item")
pounds = input("Enter pounds > ")
pence = input("Enter pence > ")
print( "Cost input for 1st item is {0}.{1}".format( pounds, pence ) )

LATEST TUTORIALS
APPROVED BY CLIENTS