Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: simple colours python 
Python :: python pandas series to dataframe 
Python :: python iterar diccionario 
Python :: how to use prettytable with python 
Python :: fuzzy lookup in python 
Python :: percentage of null values for every variable in dataframe 
Python :: python inline conditional 
Python :: replace nan with mean 
Python :: python dont exit script after print 
Python :: AdaBoost in Python 
Python :: python create virtualenv 
Python :: how to make a latency command discord.py 
Python :: hotkey python 
Python :: pathlib current directory 
Python :: calculate vif in python 
Python :: plt imshow python 
Python :: compute eigenvalue python 
Python :: np.array average row 
Python :: python emojis 
Python :: encryption python 
Python :: flask redirect to url 
Python :: removing features pandas 
Python :: python delete folder and contents 
Python :: discord.py send messages 
Python :: errno 13 permission denied python 
Python :: how to shutdown a windows 10 computer using python 
Python :: python day of the week 
Python :: jupyter lab 
Python :: python convert list of strings to list of integers 
Python :: how to find most repeated word in a string in python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =