Please help me to use python write this question thanks Writ

Please help me to use python write this question, thanks.

Write a function that takes a string as input and returns a string composed of only the odd indexes of the string.

Solution

def odd_values_function(string):
finalresult = \"\"
for i in range(len(string)):
    if i % 2 != 0:
      finalresult = finalresult + string[i]
return finalresult

print(odd_values_function(\'pqrstuvwx\'))

Please help me to use python write this question, thanks. Write a function that takes a string as input and returns a string composed of only the odd indexes of

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site