Closed MyNameisBram closed 5 years ago
Code:
bar_trace_first_three_pops = {'type': 'bar', 'x': x_values, 'y': y_values, 'text': text_values} bar_trace_first_three_areas = {'type': 'bar', 'x': x_values, 'y': [cities[0]['Area'], cities[1]['Area'],[cities[2]['Area']], 'text': text_values}
outcome: File "", line 4 bar_trace_first_three_areas = {'type': 'bar', 'x': x_values, 'y': [cities[0]['Area'], cities[1]['Area'],[cities[2]['Area']], 'text': text_values} ^ SyntaxError: invalid syntax
@MyNameisBram For your bar_trace_first_three_areas assignment, you have one too many square brackets, right before ...cities[2]... --> you did ...[cities[2]... remove that and it should work!
bar_trace_first_three_areas
...cities[2]...
...[cities[2]...
Code:
bar_trace_first_three_areas = {'type', 'bar','x': [cities[0]['City'],[cites[1]['City']] ,'y' : [cities[0]['Area'], cities[1]['Areas']]}
bar_trace_first_three_pops = {'type': 'bar', 'x': x_values, 'y': y_values, 'text': text_values} bar_trace_first_three_areas = {'type': 'bar', 'x': x_values, 'y': [cities[0]['Area'], cities[1]['Area'],[cities[2]['Area']], 'text': text_values}
outcome: File "", line 4
bar_trace_first_three_areas = {'type': 'bar', 'x': x_values, 'y': [cities[0]['Area'], cities[1]['Area'],[cities[2]['Area']], 'text': text_values}
^
SyntaxError: invalid syntax
can you check to see why this code isn't working? Thanks