Home > front end >  how to change a lower case to upper case using function
how to change a lower case to upper case using function

Time:12-25

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)
  • Related