Free Python Code Posted on Apr 28, 2024 • Edited on Apr 28, 2024 How to remove value from a tuple in Python #python #programming Hi 🙂🖐 myData = (1, 2, 3) def remove_item(value, data): # convert tuple to list data = list(data) data.remove(value) return tuple(data) print(remove_item(1, myData)) Enter fullscreen mode Exit fullscreen mode result (2, 3) Enter fullscreen mode Exit fullscreen mode Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)