s=”Hello”, t=”world”, s+=t, 则 s*3、s[-1]、s[2:8]、 s[::3]、 s[-2::-1]的完整源代码
时间: 2024-05-23 11:16:40 浏览: 76
Hello,world!源代码
s = "Hello"
t = "world"
s = t
s_times_3 = s * 3
s_last_char = s[-1]
s_slice = s[2:8]
s_every_third_char = s[::3]
s_reversed = s[-2::-1]
print(s_times_3)
print(s_last_char)
print(s_slice)
print(s_every_third_char)
print(s_reversed)
阅读全文