Python Logic Based Coding Questions On Strings