What does Arrow means in below statement | Sololearn: Learn to code for FREE!

0

What does Arrow means in below statement

Hai guys can you tell me how it works "def method (self,s:str)->lost[str]:"

2/17/2021 4:11:09 PM

P.B.V.Lalith Kumar

3 Answers

New Answer

+1

It's a type hint It does nothing to the code itself But it means the function should return that type But there will not be any type check! It's just like the __doc__ string

+2

It means the function `method` returns a datatype of the item in the dictionary `lost[str]`

0

Can you give me any example program