DCIT23 Assignment 4
DCIT23 Assignment 4
A. The text below is a list of students, their section, and their grades. The first row is the column
headings for the data which is separated by semi-colon. Using python, store the text in a variable
studs_grades as a multi-line text and save it to a file named studs_grades.txt .
STUDENT;SECTION;GRADE
Abordo;BSIT4A;2.25
Agustin;BSIT4A;1.75
Asiatico;BSIT4A;3.00
Asilo;BSIT4A;2.75
Bernabe;BSIT4A;2.25
Borja;BSIT4A;2.00
Botabara;BSIT4A;3.00
Cagoco;BSIT4A;3.00
Cariño;BSIT4A;3.00
Cruz;BSIT4A;3.00
Dapatnapo;BSIT4A;3.00
Darupan;BSIT4A;2.25
Delos Reyes;BSIT4A;3.00
Ono;BSIT4A;3.00
Torres;BSIT4A;2.50
Ugale;BSIT4A;2.25
Elpedes;BSIT4B;3.00
Endozo;BSIT4B;2.50
Estrada;BSIT4B;3.00
Evangelista;BSIT4B;2.75
Fernandez;BSIT4B;3.00
Flores;BSIT4B;3.00
Gayeta;BSIT4B;2.25
Gernale;BSIT4B;2.25
Guarino;BSIT4B;2.50
Lecaros;BSIT4B;3.00
Legarda;BSIT4B;2.50
Longcop;BSIT4B;2.75
Mabansag;BSIT4B;2.75
Malaluan;BSIT4B;2.50
Manaba;BSIT4B;2.25
Manarin;BSIT4B;3.00
Mengol;BSIT4B;3.00
Opriasa;BSIT4B;2.50
Pangan;BSIT4B;1.75
Cortez;BSIT4C;3.00
Pantilag;BSIT4C;2.25
Penuliar;BSIT4C;3.00
Relojo;BSIT4C;3.00
Reyes;BSIT4C;2.75
Salazar;BSIT4C;3.00
Santiago;BSIT4C;2.25
Seberre;BSIT4C;3.00
Suayan;BSIT4C;3.00
Sulit;BSIT4C;3.00
Tejada;BSIT4C;2.50
Tura;BSIT4C;2.25
Tuvieron;BSIT4C;1.75
Vicente;BSIT4C;2.25
Yacub;BSIT4C;2.75
B. Next, open the studs_grades.txt file and read the data into python variables for processing
to create a dictionary named studs_dict with sample items as shown below:
}
C. Next, based on the data of studs_dict , make a formatted display of the number of students
per grade, as shown below:
E. Next, based on data of studs_dict , and using the function list_students , display the
alphabetical list of students with grades higher than 2.0 (it means, between 1.0 and 1.75), as shown
in sample below:
F. Next, based on data of studs_dict , and using the function list_students , display the
alphabetical list of students with grades between 2.00 and 2.75, as shown in sample below:
G. Next, based on data of studs_dict , and using the function list_students , display the
alphabetical list of students with grades equal to 3.0, as shown in sample below:
H. Finally, based on data of studs_dict , and using the function list_students , display the
alphabetical list of students who belong to BSIT4A, as shown in sample below: