s = input("Enter a string:")
l = len(s)
meta = l // 2         #DIVISIONE INTERA PER TROVARE IL PUNTO DI META
if l% 2 == 0:                 #SE LA LUNGHEZZA è PARI
    prima_meta = s[:meta]
    seconda_meta = s[meta:]
else:                         #SE LA LUNGHEZZA è DISPARI
    prima_meta = s[:meta+1]
    seconda_meta = s[meta:]

intertita = seconda_meta + prima_meta
print(f"The inverted string is:{invertita}")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: