New submission from saeed: Hi, I define multi List in a line such as this: smoke= exercise = cholesterol = angina = stroke = attack = [0] * 2 and This work bad! if I define later line such this, problem has been solve: smoke=[0]*2 exercise = [0]*2 cholesterol = [0]*2 angina = [0]*2 stroke = [0]*2
I just change this line in my project but result changed! Is this a bug? ***************************************** ***************************************** notice to "Smoke" change in follow, "Smoke" changed from [0, 1] to [0 ,6] in a one state, for what??!! ***************************************** out put before change: > $ python3.5 ./my.py smoke= [0, 0] before income: [0, 0, 0, 0, 0, 0, 0, 0] income[ 5 ] += 1 after income: [0, 0, 0, 0, 0, 1, 0, 0] before smoke: [0, 0] 2 smoke[ 1 ] += 1 after smoke: [0, 1] stop in step before income: [0, 0, 0, 0, 0, 1, 0, 0] income[ 1 ] += 1 after income: [0, 1, 0, 0, 0, 1, 0, 0] before smoke: [0, 6] 2 smoke[ 1 ] += 1 after smoke: [0, 7] stop in step before income: [0, 1, 0, 0, 0, 1, 0, 0] income[ 5 ] += 1 after income: [0, 1, 0, 0, 0, 2, 0, 0] before smoke: [2, 10] 1 smoke[ 0 ] += 1 after smoke: [3, 10] stop in step ***************************************** out put after change: >$ python3.5 my1.py smoke= [0, 0] before income: [0, 0, 0, 0, 0, 0, 0, 0] income[ 5 ] += 1 after income: [0, 0, 0, 0, 0, 1, 0, 0] before smoke: [0, 0] 2 smoke[ 1 ] += 1 after smoke: [0, 1] stop in step before income: [0, 0, 0, 0, 0, 1, 0, 0] income[ 1 ] += 1 after income: [0, 1, 0, 0, 0, 1, 0, 0] before smoke: [0, 1] 2 smoke[ 1 ] += 1 after smoke: [0, 2] stop in step before income: [0, 1, 0, 0, 0, 1, 0, 0] income[ 5 ] += 1 after income: [0, 1, 0, 0, 0, 2, 0, 0] before smoke: [0, 2] 1 smoke[ 0 ] += 1 after smoke: [1, 2] stop in step ***************************************** :/ Thanks ---------- files: my.tar.7z messages: 279967 nosy: ezio.melotti, saeed priority: normal severity: normal status: open title: List define and Change result type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file45331/my.tar.7z _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28594> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com