Home > other >  Python list tuples input format
Python list tuples input format

Time:11-30

Want excuse me, I just started to learn programming, also don't know much about,
I bought a book python tutorial, and then in the lists and tuples in this section there are wrote
11=[1, 2, 3]
11=(1, 2, 3)
I according to this format input, are wrong
With the input
P=[1, 2, 3]
P=(1, 2, 3)
Can be output, this is how to return a responsibility?

CodePudding user response:

11=[1, 2, 3]
11=(1, 2, 3)

The two words of the left of the equals sign is variable, the variable name is the limited:

A variable name can include letters, Numbers, underscore, but Numbers as a beginning,

For example: name1 is legal variable names, and 1 name can not,

And the system key cannot be used for variable names in addition to underline a, other symbols cannot be used as a variable name
  • Related