簡體   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