write a program in Python to accept length in centimeters and convert it to metre and centimeters
Answers
Answer:
Output: Length in meter = 10 m Length in kilometer = 0.01 km. GeeksforGeeks has prepared a complete interview preparation ...
Answer:
Code is here:
1. a=float(input('enter the value in centimeter\n'))
2. z=a/100
3. print("Length in metre is",z)
4. print("Length in centimetre is",a)
Explanation:
Here, I am using float() function to take or store a float number which is also known as a decimal number just like 5.97048 is a type of float which we use in Python3 programming language. Now, I am using input() function to take data from the user as a input just like here I have to take the value of centimeter which this program convert it into meter and centimeter and give it to you in your computer screen as result or output. Just like I put the value of centimeter which is 100 and using this program the 100 centimeter converts into 1 meter as output. Here, I am using a method of numerical analysis which is known as the process of formulation in mathematics. Just like z = a/100 in this program which helps in conversion of centimeter into meter. Now, I am using print() function to print the correct answer or result as a output in our computer screen.
Learn more from this link here:
https://brainly.in/question/14689905