Question: 2. Write only the Python program for this problem. Road database: In a text file, details of various roads are available. Each line contains the

2. Write only the Python program for this problem. Road database: In a text file, details of various roads are available. Each line contains the details of one road in comma separated format. See the example below: 101, Malla Road,2010,1,2,CON 102,Karni Road,2000,2.5,BIT Serial number, road name, year of construction, length and type of road (CON: concrete, BIT: bitumen) Write Python program that takes one line of text from this data and prints the following: Print each detail separately Find out if any detail is missing and inform (missing means, the length of that text is 0) Print the age of the road Help for you: Split the text at commas and store the words in a list. Assign values of serial number road name, etc. for the corresponding variables. Print all these five variables: if the length of any value is zero, print as missing. For year, convert the text into integer. Find age as (2022-year) and print. If year is missing, print as age: missing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
