I'm trying to convert a input parameter to capital case.
text = input("write anything you wish you change to capital case: ")
def case_change(): text.upper()
print(case_change(text))
CodePudding user response:
You are not asking for an argument in the function case_change
, but passing in text
as an argument to it while calling case_change
Try:
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)
CodePudding user response:
The answer to your question is:
#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)