if else block is not working logically

Printable View