In Python, you can add annotations to the arguments and to the return value of a functionn

preview_player
Показать описание
In Python, you can add annotations to the arguments and to the return value of a function. Annotations give the user of the function and idea of what kind of data type that function is working with. You access annoutations via the __annotations__ attribute as shown in the example, or via the help function: "print(help(power))". Notice that annotations can potentially help the IDE to give you hints, but the compiler will not prevent any type errors if, for example, you return a string instead of an annotated integer.

#function #annotation #datatype
#python #python3 #development #developer #programming #it #coding #program #programmer #programminglanguage #code #coding #pythonprogramming #pythoncode #software
#softwaredeveloper #geek #computers #learntocode #learnpython
Рекомендации по теме
Комментарии
Автор

Would request you to leave some more time in the end so that we can have a good look at the output. As this is a Short video, YouTube doesn't allow to pause/seek.

NarenSandy
Автор

Love the style of the videos. Short with purpose, no silly blah blah talking, typing at a good speed and great music choice. Keep these up and you will end up with a great collection and many viewers.

ejkitchen
Автор

Вау, костыли для статической типизации, ничего себе, какой же крутой питон

maxumka
Автор

And that's how you make Python more like Scala.

jorgeestebanmendozaortiz
Автор

For me, its uncomfortable to write code without this { }

renecabuhan