Arithmetic Operator are function in mathematics which perform their role on two operands .Here You see two terms , one…
Input Output in python . Let’s understand this. How does we take input and output in python . Take a…
What is python and why we use python ?Python is a high level programming language and it is also a object oriented programming language which allow creation of object and member at run time of the program.
Inheritance 1. Inheritance is the person by which new feature are added to existing class or existing function. 2. No…
How to create polymorphism in python ?
in this program we basically learn how to create a class and how to class call by an object.
Simple program The way of using Python Graph | 2D in Graph | 3D Graph in Python
Syntax of using python graph.
This article will help you to understand the basic function of numpy programming and some use of numpy library.
You will surely get a idea that how to use numpy with your program .
This program make for fun and based on logical programming skill. Here we make a game that name is Tick Tack Toi. In this game only two player play at a time or one player play with computer. player1 = 1 and player2 = 2 this is move(symbol) assign for players. Now we are discus all about all function that are use in this Program.
1. def printBoard():
this function use for print a Tick Tack Toi Board
this function check the current game status if player1 put the move in board then is return 1 and when player2 the put move on board return 2
and count blocked line for free space if there all 8 possibility complete than game over.
3. def readmove(playername):
in this function we check move is valid or not if move is not valid than send a message on output screen for again putting the right input position
4. def computerMove():
in this function we define the random move for computer that move between 1 to 3 and return than value in form of x and y.
At last we call all functions and print the board after every move.
Here we define how to create tuples with different method