replacing items in list using for statement

前端 未结 0 646
灰色年华
灰色年华 2020-12-18 12:43

I have this very simple question.

    a = [1, 2, 3, 4, 5]
    for i in a:
    i = i+1
    
    print(a)

I thought it would print



        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题