Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python drop in tuple

my_tuple = (10, 20, 30, 40, 50)

# converting the tuple to the list
my_list = list(my_tuple)
print my_list  # output: [10, 20, 30, 40, 50]

# Here i wanna delete second element "20"
my_list.pop(1) # output: [10, 30, 40, 50]
# As you aware that pop(1) indicates second position

# Here i wanna remove the element "50"
my_list.remove(50) # output: [10, 30, 40]

# again converting the my_list back to my_tuple
my_tuple = tuple(my_list)


print my_tuple # output: (10, 30, 40)
Comment

PREVIOUS NEXT
Code Example
Python :: “no such column” after adding a field to the model 
Python :: python function guts 
Python :: how make aloop in python 
Python :: code suggestion html not working in django-html 
Python :: aw mustard 
Python :: python no mathcing key method found 
Python :: how to make a function input optional in python 
Python :: pandas crosstab function(counting) frequencies 
Python :: django rest serializer depth 
Python :: python ravel function output 
Python :: add js file in web.assets_backend 
Python :: stack overflow pop item from list in python 
Python :: function with parameters python 
Python :: how to connect smartphone camera to opencv python 
Python :: Django is MVT Not MVC 
Python :: using return values python script in batch script 
Python :: python write multiline string to file 
Python :: check if varible is emyt pyton 
Python :: Shallow copy in python and adding another array to list 
Python :: Plot Multiple ROC Curves in Python 
Python :: How to separate characters, Numbers and Special characters from given string with python 
Python :: convert set to list python time complexity method 2 
Python :: Get First From Table Django 
Python :: python code to executable online converter 
Python :: how to classify numbers in python 
Python :: python check anangram 
Python :: pyqt5 different resolutions 
Python :: dataframe no names from file 
Python :: reassign variable python 
Python :: voting classifier grid search 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =