Unable to understand the error in great circles

Screen Link:
https://app.dataquest.io/m/150/visualizing-geographic-data/10/displaying-great-circles

My Code:

fig, ax = plt.subplots(figsize=(15,20))
m = Basemap(projection='merc', llcrnrlat=-80, urcrnrlat=80, llcrnrlon=-180, urcrnrlon=180)
m.drawcoastlines()

# Start writing your solution below this line
def create_great_circles(df):
    for index,row in df.iterrows():
        if abs(row['end_lat']-row['start_lat']) < 180:
            if abs(row['end_lon']-row['end_lon']) < 180:
                m.drawgreatcircle(row['start_lon'],row['start_lat'],row['end_lon'],row['end_lat'])

dfw=geo_routes[geo_routes['source']=='DFW']
create_great_circles(dfw)
plt.show()

What I expected to happen:
the lines out of bound for the great circle should not be drawn.

What actually happened:

Your 1st plot doesn't match what we expected.


Just a minor typo/error in your code. In your second if statement -

You have end_lon twice above. The second one should be start_lon