0% found this document useful (0 votes)
52 views

CSE 1100 - Introduction To Computing I Lab 5 - File Processing Objectives

This document outlines the objectives and tasks for a lab on file processing in Python, which includes writing programs to read text and CSV files, processing data about lecturers by printing details like names and averages, and adding new entries and filtering results. Students will create text and CSV files with lecturer data, then write Python scripts to read, display, and analyze the contents of the files. The homework involves adding entries and printing filtered results based on attributes like faculty and gender.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

CSE 1100 - Introduction To Computing I Lab 5 - File Processing Objectives

This document outlines the objectives and tasks for a lab on file processing in Python, which includes writing programs to read text and CSV files, processing data about lecturers by printing details like names and averages, and adding new entries and filtering results. Students will create text and CSV files with lecturer data, then write Python scripts to read, display, and analyze the contents of the files. The homework involves adding entries and printing filtered results based on attributes like faculty and gender.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSE 1100 – Introduction to Computing I

Lab 5– File Processing

Objectives

By the end of this lab sessions students should be able to:

• Write python programs to read text/csv files


• Write python program to process csv files

Tasks

The programs in this lab session uses the data file shown in figure 1 below

1. Create and save the data in figure 1 below as:


a. A txt file called lecturers
b. A .csv file called lecturers
2. Write python programs that:
a. Read and display the content of the .txt file
b. Read and display the content of the .csv file
3. Write a python program that:
a. Print the first and last name of all female lecturers
b. Print the faculty of the older lecturer
c. Print the older and youngest lecturer by last name and gender
d. Find the average of everyone
e. Counts and prints the number of males and females

Homework

1. Write a python program that:


a. Adds two lecturers to the .csv file
b. Prints the names and gender of everyone from education

Figure 1

peter, tan,38,male,natural science,professor

susan,stephens,33,female,agriculture, tutor

joe,paul,44,male,technology, researcher

anna,bell,25,male,natural sciences, senior lecturer

joli,garcia,45,female,education, lecturer

You might also like