我想在列表中存儲1.00000,並且列表應重複1047次。任何人都知道如何使用循環在列表中的所有地方存儲1.00000。?Python:在列表中存儲Float值
我曾嘗試這樣的代碼:
print(len(data))
for content in range(1,len(data)):
globals()[content.append(1.00000)]
,我得到這個錯誤:提前
Traceback (most recent call last):
File "G:\Setups\Python\chi-1.py", line 24, in <module>
globals()[content.append(1.00000)]
AttributeError: 'int' object has no attribute 'append'
感謝。
這是很好,你已經嘗試過。所以,請將其發佈在問題中。 – doptimusprime