Print characters from a string that are present at an even index number
Write a program to accept a string from the user and display characters that are present at an even index number.
For example, str = "pynative"
so you should display ‘p’, ‘n’, ‘t’, ‘v’.
Expected Output:
Orginal String is pynative
Printing only even index chars
p
n
t
v
Hint:
Solution 1:
Solution 2: Using list slicing
need an explanation for this answer? contact us directly to get an explanation for this answer