1 )
do not do
from __future__ import braces
python will troll you with the following if you do
>>> from __future__ import braces
SyntaxError: not a chance
basically python is telling you no because python is not coded for php and javascript like syntax
its coded to tell you no
to python coders/devs its considered an inside joke but its cruel to tell someone to do that when they are asking for help
2)
(if your using python 2.7.5 or older than your fine)
for python 3.x your code is broken as it will return a syntax error
>>> a = "hsfjsdhfjdhfdhfdhf"
>>> if a is not None:
for x in a:
print x
SyntaxError: invalid syntax
you forgot ()
it should look like this
>>> a = "hsfjsdhfjdhfdhfdhf"
>>> if a is not None:
for x in a:
print(x)
h
s
f
j
s
d
h
f
j
d
h
f
d
h
f
d
h
f
also {}
is a dict in python and since python has strict syntax rules you wont be able to wrap code in it only strings in the following formats
{"lol":"omg"}
{"lol":"omg","wow":"omg"}
{"lol":{"wow":"omg","pfft":"lolwut"}}
{"lol":["lol","omg","pfft","lolwut"]}
{"lol":[["lol","omg"],["pfft","lolwut"]]}
and numerous other ways
also you can infinetly place a dict inside a dict as long as a key exists the value can be a dict, list, tuple, or string
example:
{"lol":{"wow":{"omg":{"pfft":"lolwut"}}}}
only thing is
it gets harder to split that if you dont know what to do
3)
the one thing i recommend you do is get a nice big book on python and start reading
that's the best way to learn python
especially if you want your projects to be good
or if you want to learn online
start with this
http://learnpythonthehardway.org/
and then move onto this
Datastructures and Algorithms (below is the link)
http://interactivepython.org/courselib/static/pythonds/index.html
or you can do both it doesnt really matter which order you do it in so long as you learn something