{"id":12436,"date":"2021-09-30T12:30:37","date_gmt":"2021-09-30T07:00:37","guid":{"rendered":"https:\/\/python-programs.com\/?p=12436"},"modified":"2021-11-22T18:34:38","modified_gmt":"2021-11-22T13:04:38","slug":"python-program-for-printing-odd-and-even-letters-of-a-string","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-printing-odd-and-even-letters-of-a-string\/","title":{"rendered":"Python Program for Printing Odd and Even Letters of a String"},"content":{"rendered":"

Strings in Python:<\/strong><\/p>\n

String in Python. The string is an immutable sequence data type in Python. It is a string of Unicode letters surrounded by single, double, or triple quotations… This is the second string in the Multi-line format. If a string literal must embed double quotations as part of a string, it must be enclosed in single quotes.<\/p>\n

Given the string, the task is to print even and odd index characters of the given string in Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

The given string = BtechGeeks<\/pre>\n

Output:<\/strong><\/p>\n

The odd characters in given string =  Behek\r\nThe even characters in given string = tcGes<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

The given string = uploadbutton<\/pre>\n

Output:<\/strong><\/p>\n

The odd characters in given string = ulabto\r\nThe even characters in given string = podutn<\/pre>\n

Python Program for Printing Odd and Even Letters of a String<\/h2>\n

Below are the ways to write a Python Program to print Odd and Even Letters of the given String.<\/p>\n