[Type C]Q9. Write a program that prints tables on two columns-table that helps to convert miles into kilometer.

Program code:

Clear Doubts with Computer Tutor
In case you’re facing problems in understanding concepts, writing programs, solving questions, want to learn fun facts | tips | tricks or absolutely anything around computer science, feel free to join CTs learner-teacher community: students.computertutor.in

Output:

Miles | Km 
1 | 1.609 
11 | 17.698999999999998 
21 | 33.789 
31 | 49.879 
41 | 65.969 
51 | 82.059 
61 | 98.149 
71 | 114.239 
81 | 130.329
91 | 146.419

A for loop is initiated for desired range.

Syntax of for: (Start, End, Steps):

The appropriate conversion factors are used and final output table is displayed.

Basic python functionality is demonstrated in above program.

To view all the lessons in chapter 1: http://computertutor.in/class-12-computer-science/chapter-1/

To view entire class 12 computer science study material: http://computertutor.in/resources/

You cannot copy content of this page