Practice Python Exercise 6

  • #### Ask the user for a string and print out whether this string is a palindrome or not. (A palindrome is a string that reads the same forwards and backwards.)

In [6]:
#Main method blueprint

def main():
    print(reversed_string(input("Enter a string \n")))
          
def reversed_string(a_string):
    return a_string[::-1]
          
if __name__ == '__main__':
    main()


Enter a string 
Hello
olleH

In [ ]: