Python program to convert inches into cm using functions, Exercises of Computer Science

Python program to convert inches into cm using functions

Typology: Exercises

2020/2021

Uploaded on 06/25/2021

abd10
abd10 🇮🇳

1 document

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Python program to convert inches into cm using functions :
Code :
# Program to covert inches into cm using functions
def inch_to_cm():
inch = int(input("Enter inches : "))
cm = inch * 2.54
print(f"{inch} inches = {cm} cm ")
inch_to_cm()
Output :

Partial preview of the text

Download Python program to convert inches into cm using functions and more Exercises Computer Science in PDF only on Docsity!

Python program to convert inches into cm using functions : Code :

Program to covert inches into cm using functions

def inch_to_cm(): inch = int(input("Enter inches : ")) cm = inch * 2. print(f"{inch} inches = {cm} cm ") inch_to_cm() Output :