Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tempq = []
- idx = 0
- found = False
- while idx < len(aList) and not found: #This section works out the index
- if aList[idx] == usrstr: # of the user string that needs removed
- found = True # from the queue list.
- else:
- idx = idx + 1
- if found:
- for i in range(len(aList)): #This sections takes the index previously
- if i == idx: #found and uses it to create a new list
- continue #without the element the user has requested to be removed
- tempq.append(aList[i])
- aList = tempq
- print(aList)
- return aList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement