In this program, we will take a user input as a list and replace the last and the first number of the list with the word with the help of the below-given steps.
Replace the last and the first number in a list:
Steps to solve the program
- Take a list as input.
- Replace the 1st element i.e. element with index value 0 with “SQA”.
- Replace the last element i.e. element with index value -1 in the reverse order with “TOOLS”.
- Print the list to see the output i.e. replace the last and the first number with a word.
Output :
Related Articles
Python program to check whether the given element is exist in the list or not.
Python program to remove all odd index elements.
Python program to take two lists and return true if then at least one common member.
Python program to convert multiple numbers from a list into a single number.
Python program to convert words of a list into a single string.
Python program to print elements of the list separately.