This is using python and i have a question how you turn list to be a int. so i c
ID: 3607341 • Letter: T
Question
This is using python and i have a question how you turn list to be a int. so i can add it up also i want to make it like this
if the value1 + value 2 == 1000
store the name of the city to the colum a if not go to colum b
how would you do that?
8 uinputopen ("borough-sales.csv", "r") "w" 9 unoutput = open ("sales.csv", 10 line! = uinput.readline ( ) 12 13 for line in uinput: 14 if line != line1 : 15 16 17 18 19 20 21 line = line.split(",") city = line[9]. split(",") value1 = line[1], split (",") value2 = line[2] . split (",") value3 = line[3] . split (" , ") value4 = value1 value2! print (value4)Explanation / Answer
The requirement of the question is as follows:
The input file contains area names and 3 values of sales for the year 2012,2013
and 2014 respectively. You need to read the lines and calculate the average
sales for each area. After calculating the avrerage sales, you need to categorize the area in three categories (0-3000),(3001-5000), (>5000).
So first of all just read the data and have 3 empty list.One for each category.As you are reading the file, calculate the average and populate each
list accordingly. Once the processing is complete , write it to a .csv file the data with comma separated.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.