by CodeChum Admin
Instructions:
Input
The first line contains an integer n which is the size of the array.
The next n lines contains a string on each.
The last line contains an integer which is the index to be accessed and printed.
6
Learning
Programming
made
easy
with
Cody!
5
Output
A line containing a string.
Cody!
n=int(input("Enter a positive interger: "))
list=[]
list= input('Enter elements of a list separated by space:\n ')
print("\n")
list = list.split()
print('list: ', list)
num=int(input("Enter a non negative number: "))
print(list[num])
Comments
Leave a comment