![](/img/trans.png)
[英]How do I convert only specific parts of a string to uppercase in Python?
[英]Using Python 2.7 and RawInput how do I load code into a string variable then convert to all uppercase?
我需要使用原始输入将文件转换为字符串,然后将字符转换为大写? 我该怎么做呢?
将字符串s
转换为大写: s.upper()
。
您可以像这样使用原始输入:
name = raw_input("What is your name? ")
print "Hello, %s." % name
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.