Q. One foot equals 12 inches. Write a function that accept a length written in feet as an argument  and returns this length written in inches. write a second function that ask the user for a number of feet and return this value. write a third function that accept a number of inches and display this to the screen. use these three functions to write a program that asks the user for a number of feet and tells them the corresponding number of inches.


You can understand by Watching video :-



Answer :-

def inch(feet):  						#1
	return feet*12
	
def ask():							#2
	ft=int(input("Enter number in feet :-"))
	return ft 
	
def inch2(inch):
	print(inch ,"Inches")
	
inch2(inch(ask()))

Output :-

Enter number in feet :-100
1200 Inches

>>> 

Enter number in feet :-568
6816 Inches

>>> 

Enter number in feet :-9
108 Inches

>>>


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post