ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 11 May 2017 My Price 7.00

Create a Python program

Create a Python program that takes a badly formatted data set and converts it into CSV. Details:

  • The data has three fields which we will assume are always present: a number, a name (that contains no spaces), and a salary. The data may have multiple spaces between the fields and all fields for the same row may be on different lines. Data set is here:
    2   Joe    95000 4 Steve
       35000    1  Samantha   150000     10 Leah   99000
     6   Riley   53215     7   Ashley   23424
     15    Sheyanne 225000   9  Dave  35235
        
  • Put a comment at the top of the Python file called lab5q2with your name and student number. 
  • Put the data above into the Python code file using a triple quoted string. 
  • Use split to divide up the messy data where fields are separated by spaces. 
  • Create individual lists for the ids, names, and salaries and print out each list. 
  • Output the data in CSV form:id,name,salary. 
  • Create a new list where each element is a list representing a row in the CSV file. Print this list. 
  • Create and print a new list which includes only rows where the id >= 4 and id <= 8, or the person has a salary > 50000. 
  • Output the original list in CSV form sorted by id ascending. 
  • Create and print a new list which for each row increases the salary by 50% if the length of the person's name is 3 characters or less or starts with'S'. 
  • Output the original list in CSV form sorted by salary descending. 
  • Create a function to output in CSV form and use it multiple times rather than duplicating code.

Answers

(11)
Status NEW Posted 11 May 2017 06:05 AM My Price 7.00

-----------

Not Rated(0)