def reverse_a_string(string: str) -> str:"""This method is used to reverse a string.Args:string: a string to reverse
Returns: a reversed string"""if type(string) != str:raise TypeError("{0} This not a string, Please provide a string!".format(type(string)))string_place_holder = ""start = 0end = len(string) - 1if end >= 1:while start <= end:string_place_holder = string_place_holder + string[end]end -= 1return string_place_holderelse:return string
a = "hello world"rev = reverse_a_string(a)print(rev)
a=input().split() #Splits the input on the basis of space (" ")for b in a: #declares that var (b) is any value in the list (a)print(b[::-1], end=" ") #End declares to print the character in its quotes (" ") without a new line.