Answers for "python type hint for a string"

1

python type hint for a string

# Use ": str" after an argument name
# Use " -> str" in the function header before the ending colon
def greeting(name: str) -> str:
    return 'Hello, ' + name
Posted by: Guest on September-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language