When saving python files, vim-syntactic starts debugging and raises syntax errors (specifically commas), whether its in a list, dictionary, tuple etc. Here is an image after saving python file.
Asked
Active
Viewed 66 times
0
-
you forgot the image... – Helder Sepulveda Apr 30 '18 at 23:34
-
@HelderSepu thanks. Not sure why it didn't save. – user669132 Apr 30 '18 at 23:46
2 Answers
0
The problem is your code, that is not valid syntax, I guess you are very new to python...
An object is declared using the {}
Here is how an object looks like:
farm_animals = {"sheep":"big", "cow":"huge"}
print(farm_animals)
You can try it out online on some other editor:
http://py3.codeskulptor.org/#user301_UotVM3f1Pw_0.py

Helder Sepulveda
- 15,500
- 4
- 29
- 56
-
@ HelderSepu WOW. Thanks for catching that. I read somewhere that I can create sets using curly brackets and if the items are separated like a list i.e. commas, then it'll interpret it as a set. Im a fan of vim but ill check codeskulptor out. Thanks again :) – user669132 May 01 '18 at 00:39
-
@plutonium244 Dont forget to +1 ...and mark as the answer if it solves your problem – Helder Sepulveda May 01 '18 at 12:37
0
Vim-Syntactic throws syntax errors when you don't add a space after commas.
√ animals = set(['cat', 'dog', 'mouse']) # no errors
x animals = set(['cat','dog','mouse']) # errors

user669132
- 189
- 1
- 10