Is the below declaration wrong? It doesnt give any syntax error though but some times i see that b and a value append operations do not work in case of a list.
a=b=c=[]
or
a=b=c={}
a=b=c=1 //works
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have you tried it?
It depends what you mean by “wrong”. It’s not a syntax error, but it does mean that
a,bandcrefer to the same list. So if you subsequently append something toa, you’ll see it inbandcas well.