Answer:
The program in Python is as follows:
myList = [34, 9, 32, 91, 58, 13, 77, 21, 56]
n = int(input("Elements to fetch: "))
for i in range(n):
print(myList[i],end = " ")
Step-by-step explanation:
This is the compulsory first line of the program
myList = [34, 9, 32, 91, 58, 13, 77, 21, 56]
This gets the number of elements to fetch from the list
n = int(input("Elements to fetch: "))
The iterates through the number
for i in range(n):
This prints from the first to n index
print(myList[i],end = " ")