繁体   English   中英

使用 Python 2.7 和 RawInput 如何将代码加载到字符串变量中然后转换为全大写?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM