# Python replace value

**URL:** <https://discourse.mcneel.com/t/python-replace-value/67750>\
**Category:** Grasshopper\
**Created:** [July 27, 2018, 7:45am UTC](https://discourse.mcneel.com/t/python-replace-value/67750 "2018-07-27T07:45:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edward](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/edward/32/113539_2.png) [@Edward](https://discourse.mcneel.com/u/Edward)\
**Post date:** [July 27, 2018, 7:45am UTC](https://discourse.mcneel.com/t/python-replace-value/67750/1 "2018-07-27T07:45:07Z")

</div>

I want to replace items of a list with index numbers.  
It does not work.

[01AA problem inside brep.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/f/df5e425df74bfdcd5384004ac7b790a3a3891c3d.gh) (18.6 KB)

 ![01AA%20problem%20inside%20brep](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/4/0/40cf86cfa78ac8d2f9cbc157822518df426f5014.PNG)

---

<div class="post-metadata">

**Author:** ![Amir\_Touhidi](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/amir_touhidi/32/263956_2.png) [@Amir\_Touhidi](https://discourse.mcneel.com/u/Amir_Touhidi)\
**Post date:** [July 27, 2018, 8:54am UTC](https://discourse.mcneel.com/t/python-replace-value/67750/2 "2018-07-27T08:54:10Z")

</div>

`pList_val[p]=obst` should be `pList_val[i]=obst`

 ![replace_value](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/6/9/6908c46dcaa16fc7e6a89569a984362c27b5a78c.PNG)
