How To Convert While Loop To For Loop In Python Using Anaconda