📜  在python代码示例中删除给定字符串的奇数索引字符

📅  最后修改于: 2022-03-11 14:46:30.237000             🧑  作者: Mango

代码示例1
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))