[Python] python通过加号运算符连接两个列表演示代码 →→→→→进入此内容的聊天室

来自 , 2020-08-22, 写在 Python, 查看 156 次.
URL http://www.code666.cn/view/6f8caa0e
  1. inventory = ["sword", "armor", "shield", "healing potion"]
  2.  
  3.  
  4. chest = ["gold", "gems"]
  5. print "You find a chest which contains:"
  6. print chest
  7. print "You add the contents of the chest to your inventory."
  8. inventory += chest
  9. print "Your inventory is now:"
  10. print inventory
  11.  
  12.  
  13. #//python/4506

回复 "python通过加号运算符连接两个列表演示代码"

这儿你可以回复上面这条便签

captcha