68. Problem to access multiple elements of the list

In this Python list program, we will take a user input as a list and access multiple elements of the specified index from a given list with the help of the below-given steps.

Access multiple elements of the list:

Steps to solve the program
  1. Take two lists as inputs one with values and the second one with index values. to access multiple elements from the given list.
  2. Create an empty list.
  3. Use a for loop to iterate over index numbers.
  4. Add multiple elements from the given list which is at the specified index in the empty list using the append() function.
  5. Print the list to see the output.

Output :

Related Articles

Count integers in a given mixed list

Check whether a specified list is sorted or not

Leave a Comment