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