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 in Python by Vikas

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 by Idam

Related Questions In Python

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
• 160 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
• 11,000 points
0 votes
1 answer

How to Convert usual text to executable machine code in python

what you are looking for is a ...READ MORE

answered Oct 1, 2018 in Python by Priyaj
• 56,140 points
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
+4 votes
6 answers
0 votes
1 answer

How to encode Python source code?

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

answered May 14 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 in Python by Fez

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.