Skip main navigation

While loops

How to use while loops in Python with and example from image analysis

Instead of running a loop a fixed number of times, as in a for loop, you might want to run it until some condition or other is met.

To do this you need a while loop as described in this video.

This article is from the free online

Introduction to Image Analysis for Plant Phenotyping

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now