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 random | |
birthday = 0 | |
birthdays = [] | |
counter = 0 | |
simulations = 100000 | |
for i in range (simulations): |
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
print("type x to quit") | |
b = input("up to what number: ") | |
while b != "x": | |
li = []#list that stores the numbers produced | |
List = []#list that contains all lists | |
for i in range(2,int(b)): | |
li.append(i) | |
while i != 1: | |
if i % 2 == 0: #even | |
i = i/2 |
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 socket | |
s = socket.socket() | |
host = '127.0.0.1' | |
port = 50004 | |
s.bind((host, port)) | |
s.listen(5) | |
conn = None | |
word = input("Hangman word:" ) | |
while True: | |
if conn is None: |
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
def drawing(tries): | |
if tries == 6: | |
print(" _______") | |
print("| |") | |
print("|") | |
print("|") | |
print("|") | |
print("|") | |
print("|") | |
elif tries == 5: |
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
def drawing(tries): #this is the function that draws gallows depending on how many tries the player has left | |
if tries == 6: | |
print(" _______") | |
print("| |") | |
print("|") | |
print("|") | |
print("|") | |
print("|") | |
print("|") | |
elif tries == 5: |