This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import statistics | |
from collections import Counter | |
from collections import defaultdict | |
import requests | |
import json | |
import datetime | |
from wordcloud import WordCloud | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#kind of a milestone for me, built completely on my own. | |
#task source: http://www.practicepython.org/exercise/2016/08/03/29-tic-tac-toe-game.html | |
import sys | |
def play_again(): | |
global player1_count | |
global player2_count | |
user_input = input("Do you want to play again? Type 'y' for yes or any key for no. ") | |
if user_input.startswith("y"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 means an empty square | |
#1 means that player 1 put their token in that space. | |
#2 means that player 2 put their token in that space. | |
#task: tell me whether anyone has won, and tell me which player won, if any. | |
#task source http://www.practicepython.org/exercise/2015/11/16/26-check-tic-tac-toe.html | |
game = [[1, 1, 2],[0, 1, 2],[1, 2, 1]] | |
winner = "" |