Skip to content

Instantly share code, notes, and snippets.

@holocronweaver
Forked from DreamPhage/replace_item
Created November 20, 2012 01:59
Show Gist options
  • Save holocronweaver/4115478 to your computer and use it in GitHub Desktop.
Save holocronweaver/4115478 to your computer and use it in GitHub Desktop.
Ben's replace_item function
def replace_item(inventory, item):
for item in range( len(list) ):
if item != new_item:
list[item] = new_item
return list
inventory = range(26)
new_item = ""
print replace_item(inventory, new_item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment