# How to change one element of a list

**URL:** <https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015>\
**Category:** Questions\
**Created:** [July 11, 2023, 7:50pm UTC](https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015 "2023-07-11T19:50:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TSIC333](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TSIC333](https://cl.desmos.com/u/TSIC333)\
**Post date:** [July 11, 2023, 7:50pm UTC](https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015/1 "2023-07-11T19:50:05Z")

</div>

In the plot that I’m making, I’ve got a large list of points. My goal is to make each point clickable so that they each change a specific element of a list. So, if the list is labeled “n” then clicking the fourth point should make n[4] → n[4] + 1. Is there a way of doing that? I’ve tried using the notation I just showed, something like n[index] → n[index] + 1, but desmos tells me that n[index] is a number and not a variable. I’d appreciate any help.

P.S. I’m new to desmos classroom so please let me know if there is anything wrong with the way I formatted this question.

---

<div class="post-metadata">

**Author:** ![Daniel\_Wekselgreene](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_wekselgreene/32/1819_2.png) [@Daniel\_Wekselgreene](https://cl.desmos.com/u/Daniel_Wekselgreene)\
**Post date:** [July 11, 2023, 10:43pm UTC](https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015/2 "2023-07-11T22:43:49Z")

</div>

You can’t replace an element like that, but you can basically create a new list with all elements the same except for the new one. Here is an example:

> **[replace element in a list](https://www.desmos.com/calculator/isbgir7w9n)**
>
> replace element in a list

---

<div class="post-metadata">

**Author:** ![TSIC333](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@TSIC333](https://cl.desmos.com/u/TSIC333)\
**Post date:** [July 12, 2023, 12:22am UTC](https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015/3 "2023-07-12T00:22:00Z")

</div>

That works perfectly! Thank you so much!

---

<div class="post-metadata">

**Author:** ![Mudit\_Goel](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mudit_goel/32/10391_2.png) [@Mudit\_Goel](https://cl.desmos.com/u/Mudit_Goel)\
**Post date:** [April 27, 2026, 2:13pm UTC](https://cl.desmos.com/t/how-to-change-one-element-of-a-list/5015/4 "2026-04-27T14:13:41Z")

</div>

It works perfectly! TYSM 🥰
