Python initialize multiple variables to the same initial value

前端 未结 6 1410
不思量自难忘°
不思量自难忘° 2020-12-14 06:47

I have gone through these questions,

  1. Python assigning multiple variables to same value? list behavior
    concerned with tuples, I want
6条回答
  •  天命终不由人
    2020-12-14 07:45

    First of all I would advice you not to do this. It's unreadable and un-Pythonic. However you can reduce the number of lines with something like:

    details, product_base, product_identity, category_string, store_id, image_hash, image_link_mask, results = [None] * 8
    abort = False
    data = {}
    

提交回复
热议问题