我写了一些代码
我不知道为什么我的字符串没有改变
虽然我使用的是上面的方法
def Input():
a = input('Type Anything\n')
print('\n')
a.upper()
print(a)
Input()
最佳答案
a.upper() 返回大写的字符串。所以你必须将其分配回变量 a。
def Input():
a = input('Type Anything\n')
print('\n')
a = a.upper()
print(a)
Input()
关于python - 为什么该字符串没有更改为大写,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56070007/