Simple Python Program With Logical Reasoning