Re: I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread Rhodri James
On 23/10/17 17:29, 임현준 wrote: I am a Korean student, and I am a beginner in English and Python.;( I can't understand about this def If I want to print [1,2,3,4,5] [1,2,3,4,5,100,200] I will make code like this, and I can understand code. def modify(li): li += [100,200] > list =

Re: I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread MRAB
On 2017-10-23 17:29, 임현준 wrote: I am a Korean student, and I am a beginner in English and Python.;( I can't understand about this def If I want to print [1,2,3,4,5] [1,2,3,4,5,100,200] I will make code like this, and I can understand code. def modify(li): li += [100,200] list =

I used list, def. why li += [100, 200] , and li = li + [100, 200] is different

2017-10-23 Thread 임현준
I am a Korean student, and I am a beginner in English and Python.;( I can't understand about this def If I want to print [1,2,3,4,5] [1,2,3,4,5,100,200] I will make code like this, and I can understand code. def modify(li): li += [100,200] list = [1,2,3,4,5] print(list) modify(list)