Implemented python loops