Python Logic Based Coding Questions