'Why do we use Optional[ListNode]?

I'm new to python programming. While solving a question on leetcode, I came across the below line of code.

def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]:

It'd be very helpful if someone can explain why do we use Optional[ListNode]?

**What does it do? How is it useful? **



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source