write a python program to accept a string and display the resultant string in reverse order.The string should not contain all the characters at the even position of accepted string ignoring blank spaces. Accepted string: anappleadaykeepsthedoctoraway Resultant string: aapedyepteotrwy Expected output: ywrtoetpeydepaa
Answers
Answered by
1
Answer:
Explanation:
"""Following is the python code for a reverse string function if you want to ignore all the even position letters you can introduce a conditional loop. That will allow you to get your desired result successfully.
def reverse_a_string_slowly(a_string):
new_string = ""
index = len(a_string)
while indexing:
index -= 1 # This changes the index until the string is repeated once
new_string += a_string[index] # Adds new resultant string
return new_string
"
Similar questions