About 50 results
Open links in new tab
  1. do-while loop in python [SOLVED] | DaniWeb

    Python does not have a built-in do...while, but you can emulate "run at least once, then decide" cleanly. Use a boolean updated at the end of each iteration (avoid strings like "true"/"false", …

  2. python - How to go back to a line of code...? [SOLVED] | DaniWeb

    Mar 26, 2011 · Python does not have goto; you structure control flow with loops and conditionals. To avoid being prompted twice, do not read the choice before the loop. Instead, print the menu …

  3. python - Converting celsius to fahrenheit using a ... [SOLVED]

    The formatting options are documented in the Format Specification Mini-Language. If you prefer a different loop construct later, this logic translates directly to a for loop over a sequence; see …

  4. Restart your python program. | DaniWeb

    Feb 14, 2010 · This snippet defines a function restart_program() which restarts your python program from within your python program.

  5. how to call a function for evry 10 secs ... [SOLVED] | DaniWeb

    Jun 30, 2011 · Generally, you would store the next time you want to execute, i.e. now+10 seconds, using a loop, call the function, upon the return get the time and calculate the …

  6. python - Dictionary -- states and their capitals [SOLVED] | DaniWeb

    Hello, I am trying to create a program that uses a dictionary to associate American states with their capitals. It has an interactive loop that exits ...

  7. python - How do i go back to a certain line of code? | DaniWeb

    You generally do not "jump back to a line" in Python. You structure the code so it naturally loops to where you want. @woooee was right to suggest a function, and @Schol-R-LEA showed the …

  8. python - Tkinter Restart program | DaniWeb

    Feb 12, 2012 · hi, is there any way to restart Tkinter program while running. I would like to put some button that will when pressed put everything as it was in moment ...

  9. python - Beginner: How do I read in one bit/byte ... | DaniWeb

    In Python 2.6 you cannot read single bits directly from a file; files are byte-oriented. The usual pattern is to read bytes in binary mode and unpack each byte into 8 bits. Also note that read() …

  10. python - # of times a number can be divided by 2 ... | DaniWeb

    Nov 11, 2011 · That's because there is an infinite loop in the program. Because "n" does not change, the while loop never exits. We have no way of knowing how you want to change the …