India Languages, asked by anjanakshatri96, 5 hours ago

accept string from user and display even index of that string​

Answers

Answered by ankitha7777
3

Answer:

\huge\pink{\mid{\underline {\overline{\tt answer}}\mid}}

Method 1: Using string slicing Above program reads a string as input and creates a new string with characters at index which are multiples of 2. Expression str[::2] fetches all characters in a string which have an index difference equal to the value supplied at the right starting from the value at the left.

Similar questions