Search
 
SCRIPT & CODE EXAMPLE
 

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))
Comment

PREVIOUS NEXT
Code Example
Python :: finding 2 decimal places python 
Python :: python zip lists into dictionary 
Python :: procfile heroku django 
Python :: pandas sample seed 
Python :: python nameerror input 
Python :: python filter list of int and strings 
Python :: Jupyter notebook: let a user inputs a drawing 
Python :: django admin order by 
Python :: how to get input from user in python 
Python :: django check if user is staff in template 
Python :: python expression factorisation 
Python :: numpy round 
Python :: get number of bits for integer in python 
Python :: os run shell command python 
Python :: print undeline and bold text in python 
Python :: matplotlib title chopped off 
Python :: python template generics 
Python :: redirect django 
Python :: change python 3.5 to 3.6 ubuntu 
Python :: iterate over every alternate character in string python 
Python :: pygame change icon 
Python :: print a to z in python 
Python :: average out all rows pandas 
Python :: messages django 
Python :: suppress warning jupyter notebook 
Python :: barabasi albert graph networkx 
Python :: usong brave browser pyhton 
Python :: df to np array 
Python :: python sum comprehension 
Python :: new event loop asyncio 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =