Python code Tic Tac Toe game

0 votes
I'm trying to write a python code for Tic Tac Toe game. I currently have a code that selects a player and asks the player to select a sign. I need help in writing the code for selecting the other player and making the other player select a sign. Can anybody help me out with this? Thank you
May 28, 2019 in Python by Vikas

1 answer to this question.

0 votes

You could use random.shuffle

from random import shuffle

players = ['Player 1', 'Player 2']
player1, player2 = players

print(f"First Turn: {player1}")
sign_player_1 = input(f"{player1}, Choose a sign for yourself: ")
sign_player_2 = input(f"{player2}, Choose a sign for yourself: ")
answered May 28, 2019 by Idam

Related Questions In Python

0 votes
2 answers

How to draw a tic tac toe board in python?

I also want to know the answer ...READ MORE

answered Jun 25 in Python by anonymous
0 votes
1 answer

Normal Python code equivalent to given list comprehension

You can try this code list1=[] for i in ...READ MORE

answered Jun 8, 2018 in Python by jain12
• 170 points
0 votes
1 answer

GAE: python code to check if i'm on dev_appserver or deployed to appspot

I don't know if you still need ...READ MORE

answered Sep 10, 2018 in Python by anonymous
+1 vote
1 answer

How to use GUI that comes with Python to test your code?

Hey @alex0809, When your testing a website ...READ MORE

answered Sep 24, 2018 in Python by Vardhan
• 13,180 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,373 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
0 votes
1 answer

How to encode Python source code?

Python allows you to encode the source ...READ MORE

answered May 14, 2019 in Python by Jimmy
0 votes
1 answer

Checkers that can check hints in python source code

Static type checkers such as Mypy, Pyre, ...READ MORE

answered Jun 7, 2019 in Python by Fez