Professional Documents
Culture Documents
Technology Sample
Technology Sample
ipynb - Colaboratory
def reverse_string(string):
index = len(string) - 1
reversed_str = ""
while index >= 0:
reversed_str += string[index]
index -= 1
return reversed_str
def remove_spaces(string):
index = 0
no_spaces_str = ""
while index < len(string):
if string[index] != ' ':
no_spaces_str += string[index]
index += 1
return no_spaces_str
def is_palindrome(string):
string = remove_spaces(string)
reversed_str = reverse_string(string)
def main():
print( reverse_string("aeiou") ) # uoiea
print( remove_spaces("ae io ua") ) # aeioua
main()
uoiea
aeioua
True
True
True
https://colab.research.google.com/drive/1pLD7GVWxE4WG8M5j7rkPWNVZxihv0zUI#printMode=true 1/2
12/6/23, 11:40 PM Technology_Sample.ipynb - Colaboratory
https://colab.research.google.com/drive/1pLD7GVWxE4WG8M5j7rkPWNVZxihv0zUI#printMode=true 2/2