About 93,900 results
Open links in new tab
  1. 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.

  2. python - Repeatedly asking for input | DaniWeb

    Dec 14, 2011 · A common, idiomatic way to keep asking the user for input is a sentinel-controlled loop: run forever and break only when the user asks to quit. Because True is always truthy, …

  3. 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 …

  4. python - persistence of a number | DaniWeb

    Recommended Answers You need to set y to 1 at the top of the loop so it's initialized every iteration. Your do {}while () condition should be x > 0 since you want to multiply every digit …

  5. python - Changing For loops to while loops and vice ... [SOLVED]

    Oct 8, 2015 · Do not name functions after built‑ins like int; it shadows the real built‑in and leads to confusing errors later. In Python, a bare comparison like i % 3 == 2 by itself does nothing; you …

  6. python - Loop through a year [SOLVED] | DaniWeb

    Two small improvements make this task simpler and more robust in modern Python. First, iterate with an end-exclusive boundary instead of guessing the number of days. This works for any …

  7. How to do Input in Python? [SOLVED] | DaniWeb

    Dec 2, 2004 · Quick version check: in Python 3, input() always returns a string and does not evaluate code. In Python 2, raw_input() returns a string while input() evaluates the input as …

  8. python - login program with loop | DaniWeb

    I have to make a login program where the username and password are taken from an existing file. I have successfully, in my opinion, opened, read, and ...

  9. python - ImportError: No module named tkFileDialog | DaniWeb

    Seeing this on Python 3.x is expected: tkFileDialog is the Python 2 name, while Python 3 moved it under the tkinter package as tkinter.filedialog. Also note that from tkinter import * does not …

  10. python - NameError: name 'guess' is not defined | DaniWeb

    I am very new to both programming and Pyhton and while trying to do some practice using A byte of python ...