Question: The code I am trying to use is: def UserInputReturns ( ) : user _ input = input ( Please enter a string:
The code I am trying to use is:
def UserInputReturns:
userinput inputPlease enter a string:
# Example transformation: return the uppercased version of the input
return fYou entered: userinput.upper
def ParameterReturnsinputstring:
# Example transformation: return the reversed version of the input
return fThe reversed input is: inputstring::
def UserInputPrints:
userinput inputPlease enter a string:
# Example transformation: print the lowercased version of the input
printfYou entered: userinput.lower
def ParameterPrintsinputstring:
# Example transformation: print the length of the input string
printfThe length of your input is: leninputstring characters"
Instructions:
Please create Pythonfun.py file that contains all four functions.
Write a function UserInputReturns that gets a string as input from the user and returns a message. Write a function ParameterReturns that gets a string as input in its parameter and returns a message. Write a function UserInputPrints that gets a string as input from the user and prints a message. Write a function ParameterPrints that gets a string as input in its parameter and prints a message.
All functions use string methods to either examine or transform the string.
Sample calls and output
print UserInputReturns printParameterReturnsstring of characters' UserInputPrints ParameterPrintsChocolate Please enter a string of characters:Good day! The length of the string is String converted to upper case is STRING OF CHARACTERS Please enter a string of characters:my string The string capitalized is My string The first letter of the string is C
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
