私信  •  关注

Chowdeswara Rao

Chowdeswara Rao 最近创建的主题
Chowdeswara Rao 最近回复了
8 年前
回复了 Chowdeswara Rao 创建的主题 » 在python3中如何将单词向后翻转?在这种情况下[副本]

这里简单地说:

打印“loremipsum”[-1::-1]

一些逻辑上:

def str_reverse_fun():
    empty_list = []
    new_str = 'loremipsum'
    index = len(new_str)
    while index:
        index = index - 1
        empty_list.append(new_str[index])
    return ''.join(empty_list)
print str_reverse_fun()

输出:

麝香草酚