Home assignment 1#
Last updated: 2026-02-12 16:07:31
Question 1#
From the
'Institutio'column in the'education.csv'file, choose an intitution name that starts with the same letter as your first or last name (for example,'מולדת'if your first name is'מיכאל'). You can do this step manually outside of the submitted Python code. (See Convert CSV file to a different encoding for code that can be used to convert a CSV file to thewindows-1255encoding if you want to view the file in Excel.)Define a
strvariable with the selected nameFind and print the name (
'Institutio'column) and type ('type'column) of the selected institution, in one line, separated by commasIf there is more than one institution having the selected name—then you need to print the string with name and type for each institution
Note: use
encoding='utf-8'when reading the file
מולדת, בית ספר
מולדת, גן ילדים
Question 2#
The
'stops.txt'file lists public transport stations in Israel, and includes the following columns:
'stop_id'—Stop ID
'stop_name'—Stop name
'stop_lon'—Stop longitude
'stop_lat'—Stop latitudeUsing these four columns in the
'stops.txt'file, find the IDs and names of all bus stops within a radius of 500 \(m\) around Kibbutz Yotvata(35.0594,29.8961), collect them into alistof(stop_id,stop_name)tuples, and then print the list.Use the
distancefunction definition from Example: distance function to calculate the distances between each public transport station and Kibbutz Yotvata.Hint: use a conditional to append the corresponding station name to the list of results if the distance is smaller than
500.Note: use
encoding='utf-8-sig'when reading the file
[('12129', 'צומת יטבתה'),
('12230', 'יטבתה מרכז'),
('12275', 'צומת יטבתה'),
('42217', 'יטבתה'),
('43681', 'בית הספר מעלה שחרות'),
('47976', 'אולם ספורט דוביק/יוטבתה')]