95. Problem to remove the 2nd character of each word from list.

In this Python list program, we will take a user input as a list and remove the 2nd character of each word from the list with the help of the below-given steps.

Remove the 2nd character from words in list:

Steps to solve the program
  1. Take a list of words as input.
  2. Use a for loop to iterate over words in the list.
  3. Remove the 2nd character of each word from the given list using indexing.
  4. After removing the character add those words to another list.
  5. Print the list to see the output.
				
					#Input list
list1 = ["Hello", "student", "are", "learning", 
         "Python", "Its", "Python", "Language"]
list2 = []

for value in list1:
    list2.append(value[:1]+value[2:])

#printing output
print(list2)
				
			

Output :

				
					['Hllo', 'sudent', 'ae', 'larning', 'Pthon', 
'Is', 'Pthon', 'Lnguage']
				
			

Related Articles

Convert 3rd character of each word to capital

Get length of each word and add it as dictionary

Leave a Comment