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!
Source code
n=int(input("Enter the size of the array: "))
strs=[]
print("\nEnter ",n," strings: ")
for i in range(n):
s=input()
strs.append(s)
x=int(input("Enter the index to be accessed and printed: "))
print(strs[5])
Output
Comments
Leave a comment