Hi all! Would really appreciate some help here. This is part of my homework (and I am still super new to Python so I need some help). So I have a set of data, and I'm supposed to get all altitudes given a list of listing. Here's my code so far but I have no idea what I'm doing wrong so would appreciate some help!
I was given the following hints and I did my code shown after that.
Hint
Create a results list
Extract the latitude and listing id of each row
Check listing id exists within the all listings
If true, append the latitude into the results list
Return results list
Input: airbnb_data as data, a list of listing_ids
Return: A list of latitudes
I was given the following hints and I did my code shown after that.
Hint
Create a results list
Extract the latitude and listing id of each row
Check listing id exists within the all listings
If true, append the latitude into the results list
Return results list
Input: airbnb_data as data, a list of listing_ids
Return: A list of latitudes
def get_all_latitude(airbnb_data): results = [] for row in range(airbnb_data): listing_id = row[1] latitude = row[17] if listing_id in airbnb_data: results.append(row) return results