Python

Submitted by: 
#‎using‬ python 3.3.4 to develop sudoku game ‪#‎sudoku‬ game from random import randint ‪#‎generate‬ board def build_board(): board=[] for i in range(9): block=[[" "," "," "], [" "," "," "], [" "," "," "]] board.append(block) return board ## ## Ensure no other block in the same row has the value ## def row_available(block, row, board, num): # Determine which of the main 3 rows this 3x3 block is...
Submitted by: 
Introduction: This tutorial is on how to create a random number generator in Python. Imports: Before we begin, we first need to import the random module... import random This allows us to use the random modules functions such as 'randrange' and 'randint'. Random From Zero: To get a random number from the beginning (zero/0), we can simply call the 'randrange' function from the random module and...
Submitted by: 
Introduction: This tutorial is on how to create a simple, hardcoded polling system in Python. Hardcoded? Hardcoded is when something is coded directly in to the program, other terms include; hardcoding and hardcode. I would only recommend harcoding if the amount that needs to be hardcoded is very small (such as only a few options in this polling system). This is similar to the use of loops. You...
Submitted by: 
Introduction: In this tutorial we will continue making our local user management system in Python. In part three we made the remove record function which paired with a lot of other new functions. Important: Although I keep interchanging the words records and users, this system can be used to keep any records of information, but I am using this example as a user management system. Now: This...
Submitted by: 
Introduction: In this tutorial we will continue making our local user management system in Python. In part two we made the list users and change file path options, now we are going to be making a remove users function/choice/option in the menu. Important: Although I keep interchanging the words records and users, this system can be used to keep any records of information, but I am using this...
Submitted by: 
Introduction: In this tutorial we will continue making our local user management system in Python. In part one we made the main menu system, and the first option to add a user. This tutorial will be on a second option, listing users, and a settings option to change the file name. Important: Although I keep interchanging the words records and users, this system can be used to keep any records of...
Submitted by: 
Introduction: In this tutorial we will begin making a local user management system in Python. We have done this before in a simple SQLite database, but this series will be storing the information in simple plain text files ready for editing manually and portable safe. The Main System: First we want to create a main function which will be our menu system. The user will loop around this until they...
Submitted by: 
Introduction: This tutorial is on how to create a user management system in Python using SQLite. The Database: First we need to create the database to store the information, to do this open CMD (on Windows) and type cd followed by your SQLite installation path, mine is: cd /d G: cd Libaries\Documents\SQLite Now we use the command sqlite3 followed by the database name followed by the extension for...
Submitted by: 
Introduction: This tutorial is on how to set up SQLite and Python to use databases within your scripts. Downloading SQLite: First we need to download SQLite. To do this, go to http://sqlite.org/download.html and download the latest pre-compiled binary release for your operating system - I am using Windows, I am unsure if this tutorial 100% works with other systems. Once you have downloaded it,...
Submitted by: 
Introduction: This tutorial will be covering how to create a hangman game based on ASCII characters in Python. Imports: First we need to import the random package to randomise which word the PC will choose... import random ; Variables: Next we need a list of possible words for the pc to choose, we use a full caps name and a tuple to store the list of information because it will not change...

Pages