DEV Community

Discussion on: Day-11 Height Checker

Collapse
 
lishagopi profile image
Lishagopi

Can you please explain me the function line...being the absolute python beginner...I can't understand the thing after self keyword.

Collapse
 
mridubhatnagar profile image
Mridu Bhatnagar

This structure is actually particular to Leetcode. After self the following things are happening:

  1. parameter named heights is being passed to the method.
  2. List[int] - This mean built-in object is List. And list contains integer elements.
  3. -> int - This means the method will return an integer.

In the python code that we normally write. We don't usually use this format. Hence, this might be appearing unusual. This is just another way of passing the parameters.

You can read more about a library named mypy in python. To find more examples.

Collapse
 
lishagopi profile image
Lishagopi

Thanks a lot...❤