Random problem solving code python code!!