** * This article is from Udemy "[Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style](https://www.udemy.com/course/python-beginner/" Introduction to Python3 taught by active Silicon Valley engineers + application + American Silicon Valley style code style ")" It is a class notebook for myself after taking the course of. It is open to the public with permission from the instructor Jun Sakai. ** **
function
# a,b,The return value is an int type, and a+Returns b
def add_num(a: int, b: int) -> int:
return a + b
r = add_num(10, 20)
print(r)
result
30
In Python3.6 and above
num: int = 10
Then
" Num = 10
and num
should be int type",
I was able to describe it like this.
-> Int
is
"Make the return value an int type"
means.
There aren't many cases like this, but I may write something like this, so put it in the corner of your head.
Recommended Posts