答案:
def reverse(s): return s[::-1]
main
s = "ChatGPT"
print ("The original string is : ",end="") print (s)
print ("The reversed string(using slicing) is : ",end="") print (reverse(s))
答案:
def reverse(s): return s[::-1]
s = "ChatGPT"
print ("The original string is : ",end="") print (s)
print ("The reversed string(using slicing) is : ",end="") print (reverse(s))