T
Thomas Philips
I'm teaching myself python and in the course of playing around with
dictionaries, I tried to create the following trivial dictionary
{1:'one', 2:'two'}
So I enteredSyntaxError: keyword can't be an expression
As this did not work, I triedSyntaxError: keyword can't be an expression
andSyntaxError: keyword can't be an expression
as well asSyntaxError: keyword can't be an expression
Out of curiosity, I tried{'two': 2, 'one': 1}
Why does this last attempt work, and more importantly, why did my four
earlier attempts fail? I might add that I have no trouble getting what
I want with{1: 'one', 2: 'two'}
or{1: 'one', 2: 'two'}
Sincerely
Thomas Philips
dictionaries, I tried to create the following trivial dictionary
{1:'one', 2:'two'}
So I enteredSyntaxError: keyword can't be an expression
As this did not work, I triedSyntaxError: keyword can't be an expression
andSyntaxError: keyword can't be an expression
as well asSyntaxError: keyword can't be an expression
Out of curiosity, I tried{'two': 2, 'one': 1}
Why does this last attempt work, and more importantly, why did my four
earlier attempts fail? I might add that I have no trouble getting what
I want with{1: 'one', 2: 'two'}
or{1: 'one', 2: 'two'}
Sincerely
Thomas Philips