r/pythonhelp • u/Medical_Culture • Oct 21 '20
Coding Help
I need help creating a code. The prompt is: Write a function showChar to display the character at a certain index in a given string. And an example of the execution is:
Enter a string: New York
Enter an index: 2
The character at index 2 in New York is w
>>>
Enter a string: New York
Enter an index: 8
Invalid index!
3
Upvotes
1
u/Darkmatter_Cascade Oct 21 '20
Think about this. Why is 'w', the third letter, at index 2?