# 手写一个函数,将 ‘123456789,i am a student’ 作为参数输入,函数返回 ‘12346789,student a am i’,注意是单词位置颠倒,而不是字母位置颠倒deffunc():
a ="123456789, i am a student"
list1 = a.split()
list2 = list1[::-1]
b = list2[-1]
c = list2[0:4:1]
d =" ".join(c)print(b + d)
func()
只颠倒字母的顺序,数字不变# 手写一个函数,将 ‘123456789,i am a student’ 作为参数输入,函数返回 ‘12346789,student a am i’,注意是单词位置颠倒,而不是字母位置颠倒def func(): a = "123456789, i am a student" list1 = a.split() list2 = list1[::-1] b = list2[-1] c = list2[0:4:1] d = " ".j