我正在嘗試將輸入引數轉換為大寫。
text = input("寫下你想改成大寫的任何內容:")
def case_change(): text.upper()
列印(case_change(文本))
uj5u.com熱心網友回復:
您不是在函式中要求引數case_change,而是在text呼叫時作為引數傳入case_change
嘗試:
text = input("write anything you wish you change to capital case: ")
def case_change(text):
return text.upper()
upper_case = case_change(text)
print(("capital case is: " upper_case)
uj5u.com熱心網友回復:
你的問題的答案是:
#your text
text = input("write anything you wish you change to capital case: ")
#function
def case_change(text):
return text.upper()
your_uppercase = case_change(text)
#print
print(("uppercase: " your_uppercase)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/392878.html
標籤:蟒蛇-3.x
上一篇:為什么unicode形式的字串不等于它的unicode代碼點值?
下一篇:PythonAES-256-CBCEncrypttoPHPDecryptwithopenssl_decryptreturnfalse
