def f(in_str):
out_str = in_str.upper()
return True, out_str # Creates tuple automatically
succeeded, b = f("a") # Automatic tuple unpacking
More Related Contents:
- How to add numbers inside a variable? [closed]
- Trying to use a returned value without the other parts of a function [closed]
- How can you dynamically create variables? [duplicate]
- What is the purpose of the single underscore “_” variable in Python?
- How do I put a variable’s value inside a string?
- Getting the name of a variable as a string
- How to use a variable inside a regular expression?
- How do I check if a variable exists?
- Are Python variables pointers? Or else, what are they?
- Checking multiple values for a variable [duplicate]
- How to get the original variable name of variable passed to a function
- How would I access variables from one class to another?
- Variable assignment and modification (in python) [duplicate]
- How can I print variable and string on same line in Python?
- What is the naming convention in Python for variable and function?
- How do I pass variables across functions?
- Convert Variable Name to String?
- If two variables point to the same object, why doesn’t reassigning one variable affect the other?
- Keep persistent variables in memory between runs of Python script
- How to create module-wide variables in Python? [duplicate]
- How do I save and restore multiple variables in python?
- Setting variables with exec inside a function
- Determine if variable is defined in Python [duplicate]
- Best way to retrieve variable values from a text file?
- How do I create a multiline Python string with inline variables?
- How to obtain values of request variables using Python and Flask [duplicate]
- How does Python return multiple values from a function?
- Is a variable the name, the value, or the memory location?
- How can a name be “unbound” in Python? What code can cause an `UnboundLocalError`?
- Copied variable changes the original?