python基础:字符串大小写互换

时间:2026-02-15 13:15:49

1、打开cmd

python基础:字符串大小写互换

2、进入Python交互界面

python基础:字符串大小写互换

3、定义字符串 str = 'This Is A Test'

python基础:字符串大小写互换

4、用swapcase()函数进行大小写互换 newStr = str.swapcase()

python基础:字符串大小写互换

5、打印输出

python基础:字符串大小写互换

1、1.打开cmd

2.进入Python交互界面

3.定义字符串 str = 'This Is A Test'

4.用swapcase()函数进行大小写互换 newStr = str.swapcase()

5.打印输出

© 2026 途途旅游
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com