Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

removing odd index character of a given string in python

def modify(string):  
  final = ""   
  for i in range(len(string)):  
    if i % 2 == 0:  
      final = final + string[i]  
  return final
string=raw_input("Enter string:")
print("Modified string is:")
print(modify(string))
Source by www.sanfoundry.com #
 
PREVIOUS NEXT
Tagged: #removing #odd #index #character #string #python
ADD COMMENT
Topic
Name
2+3 =