"Delete every third character: Given a string. Delete from it all the characters whose indices are divisible by 3" - Snakify python coding question

 



 

CODING QUESTION

Given a string. Delete from it all the characters whose indices are divisible by 3


SOLUTION

s=str(input())
n=len(s)
for i in range(n):
    if i%3==0:
        print(end="")
    else:
        print(s[i],sep='',end='')

 

Input : Python

Output : yton