Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Help change from a while loop to a for loop
Post: RE: Help change from a while loop to a for loop

(Nov-09-2018, 11:20 AM)stullis Wrote: Larz's explanation is the best. As for my suggestion, here's what I had in mind: def displayDigits(number): for x in range(number): divisor = 10 **...
captwiggum Homework 10 5,324 Nov-09-2018, 12:24 PM
    Thread: Help change from a while loop to a for loop
Post: RE: Help change from a while loop to a for loop

(Nov-09-2018, 10:52 AM)Larz60+ Wrote: Looking at the original code, this is a poor conversion request. In reality all the loop is doing is count number of digits, so to know how to iterate the loop ...
captwiggum Homework 10 5,324 Nov-09-2018, 10:57 AM
    Thread: Help change from a while loop to a for loop
Post: RE: Help change from a while loop to a for loop

(Nov-09-2018, 12:33 AM)Larz60+ Wrote: show what you have tried here'a a simple for loop that starts at 2 increments by 6 up to 38 Since it is zero based, terminator is one more (39) >>> fo...
captwiggum Homework 10 5,324 Nov-09-2018, 09:20 AM
    Thread: Help change from a while loop to a for loop
Post: RE: Help change from a while loop to a for loop

(Nov-08-2018, 10:17 PM)Larz60+ Wrote: suggest a reading assignment: https://wiki.python.org/moin/ForLoop Hi, Thanks for taking the time to reply and suggest a link but I've done all the reading on t...
captwiggum Homework 10 5,324 Nov-08-2018, 10:30 PM
    Thread: Help change from a while loop to a for loop
Post: Help change from a while loop to a for loop

Hi, I'm a total beginner and for class I have to change this while loop to a for loop and I just can't figure it out, help would be much appreciated. It is a simple function to count the number of dig...
captwiggum Homework 10 5,324 Nov-08-2018, 09:23 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020