``````var P1 = 5
var P2 = 10
var P3 = 15
var Points
Points = [P1, P2, P3]
for i in Points:
i = 0
print(Points
``````

That's my code
It prints 5. Why can't I change a value in a table?

in Engine

The for loop `i` is a copy of each element in the array, the same way this doesn't change `P1`:

``````var P1 = 5
var P2 = P1
P2 = 0
print(P1) # 5
``````

If you want to change an array element, you need to loop using a index:

``````for i in Points.size():
Points[i] = 0
print(Points) # zero
``````
by (418 points)
{"ft_lang_label":"__label__en","ft_lang_prob":0.80833316,"math_prob":0.97426564,"size":269,"snap":"2022-27-2022-33","text_gpt3_token_len":92,"char_repetition_ratio":0.12075472,"word_repetition_ratio":0.0,"special_character_ratio":0.34200743,"punctuation_ratio":0.09375,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.997905,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-10T04:26:33Z\",\"WARC-Record-ID\":\"<urn:uuid:b6934c3a-71a4-4afd-bee6-9814a2e2da94>\",\"Content-Length\":\"21473\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:482ef479-9d83-4f3d-a627-db3eca58f11f>\",\"WARC-Concurrent-To\":\"<urn:uuid:0a97e639-7b02-438f-8d97-d2a802f8cdc1>\",\"WARC-IP-Address\":\"212.85.158.4\",\"WARC-Target-URI\":\"https://godotengine.org/qa/122725/table-isnt-working-the-way-i-thought-it-would?show=122743\",\"WARC-Payload-Digest\":\"sha1:5MNRUTUY35RIETFBJVFVRKKHFQILQAHZ\",\"WARC-Block-Digest\":\"sha1:WHGQWUCG334FMNWX75NY2NBOZYACVJAG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882571147.84_warc_CC-MAIN-20220810040253-20220810070253-00728.warc.gz\"}"}