TL DR: assuming yours dequeis called d, just check d[-1], since the "rightmost" element in deque is the front (you can test it before the deck length to make sure it is not empty). Taking the @asongtoruin suggestion, use if d:to check if deque is empty (this is equivalent if len(d) == 0:, but more pythonic)
Why not convert to a list?
deque , . deque , , - . :
Deques -, O (1) .
, O (n) pop (0) (0, v) , , .
, "" . :
- O (1) , O (n) . .
list O (n), O (1).