I am a beginner in python and am trying to tackle this problem and just cannot get my output right. I am trying to change the value of an item in a list and pass the item to a new list.
mylist = []
test = ['path', 'name', 'user1', 'orig']
for i in test:
if 'user' in i:
mylist = 'user' # or i[:-1]
else:
mylist = i
mylist
any help would be appreciated or point me to the answer
Damon