怎样在 Python 进行字符串排序

 时间:2024-11-02 09:47:59

1、首先,右键点击【项目】,创建一个【Python】文件

怎样在 Python 进行字符串排序

2、接着,在右侧输入代码,代码写在【下一步】

怎样在 Python 进行字符串排序

3、然后,复制代码粘贴到文件中if __name__ == '__main娄多骋能__': str1 = raw_input('input string:\n') str2 = raw_input('input string:\n') str3 = raw_input('input string:\n') print str1, str2, str3 if str1 > str2: str1, str2 = str2, str1 if str1 > str3: str1, str3 = str3, str1 if str2 > str3: str2, str3 = str3, str2 print 'after being sorted.' print str1, str2, str3

怎样在 Python 进行字符串排序

4、随后,右键选择运行代码文件

怎样在 Python 进行字符串排序

5、最后,在最下面就可以看到运行结果了

怎样在 Python 进行字符串排序
热门搜索
生活知识 高中物理知识点总结 贡菊的功效与作用 什么汤降火 什么运动减肥最快 连花清瘟胶囊的功效与作用 嘴角开裂用什么药 水杯什么牌子好 拔罐的作用 油性皮肤用什么护肤品