Write a Python program to display the first and last element from the following list.


Using the index, we get the first and last items.

To learn more about the index: Python String Methods

myList = ['Python','Angular', 'Java', 'HTML']

 

Program


myList = ['Python','Angular', 'Java', 'HTML']
print(f'First Element is {myList[0]} and Last Element is {myList[-1]}')

 

Output


First Element is Python and Last Element is HTML