goal = 'career-change' reason = 'https://twitter.com/Qwiery/status/727849124138192896' # PTP: Programming Stream (url = 'http://deborahroberts.info/2016/02/diving-into-data-syllabus-2/') longlist = ['Java', 'Python', 'SQL', 'VBA', 'R'] start_with_end_in_mind = {'datascience': ['R', 'Python'], 'machinelearning': ['Python', 'R']} choice1 = start_with_end_in_mind.get('datascience') choice2 = start_with_end_in_mind.get('machinelearning') shortlist = list() for item in choice2 : if item in choice1 : shortlist.append(item) quit() # Due to unorthodoxy I executed the last line just after line 02