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", and prefer logical …

  2. 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 ...

  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 once, …

  4. python - Converting celsius to fahrenheit using a ... [SOLVED] | DaniWeb

    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 Python’s …

  5. python - Concentric Circles [SOLVED] | DaniWeb

    I need help creating a python function that makes concentric circles. I already have a function that makes a circle (from the Python Programming book), so I thought I'd use a for loop; however, I'm not …

  6. python - Getting an input from arrow keys. [SOLVED] | DaniWeb

    Okay, I'm trying to make a python game (not with pygame), I want it to use the arrow keys. But the thing is, I don't know how to get it ...

  7. Finding the largest and smallest numbers ... [SOLVED] | DaniWeb

    Nov 6, 2012 · #Name: Calum Macleod #Date : November 6, 2012 #Purpose: A Python program with a loop that lets the user enter a series of whole numbers. #The user should enter the number -99 to …

  8. 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() returns an empty …

  9. python - Pickup Sticks game | DaniWeb

    Nov 27, 2011 · After each move, immediately check for n == 0 and declare the loser of that move. Avoid recursion for re-prompting the initial pile; a loop is simpler and safer. For the underlying theory, see …

  10. python - Closing Program on ESCAPE [SOLVED] | DaniWeb

    In Pygame, quitting on ESC is best handled inside the event loop. Watch for both the window close button and the ESC key, and make sure you cleanly shut down with pygame.quit() before exiting …