Skip to content

Instantly share code, notes, and snippets.

import socket
import random
import threading
class game:
def __init__(self):
self.number = random.randint(1, 30)
def guess(self, number):
distance = abs(self.number - number)
# Download a dictionary
# see https://stackoverflow.com/questions/18834636/random-word-generator-python
from urllib.request import urlopen
import random
wordsURL = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain"
response = urlopen(wordsURL)
wordList = response.read().splitlines()
grade = input("What was the grade? ")
if grade >= 0 and grade <=39:
print("Fail.")
elif grade >= 40 and grade <= 59:
print("Pass.")
elif grade >= 60 and grade <= 79:
print("Merit.")
elif grade >= 80 and grade <=100:
print("Distinction.")
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3t3+VaQwviqMwjLyRYCIvc2pyMo9G5hamc9Aj2TYsZsFO6imfyyM4amaenlrGkMOMXke6ZJNRJ4Uv6xdDzD74cmF9NS66flEL0fBTVIiuhrr1d/qvNY7Zu7XWxKvXMcMmfm2x2pDQfRGKcOfr6A2r8MZ+SWkhASdo2zZYNzBETfgICmhGsl/+qCFshbgH1mmngCA2w9qUXPf6P3a4ZOBu8wg8gJ0xt+7oA5rXiSqTl3biZ5z9pyIL99JIABnvNwDwbVZPbPIEv37/wZNV0yLrDMqCeV1EjlflyurMCTydJE8h3Bhex6lX2w0stsx9TnP0niJJFE7JnCHR1e2ooqZr leegeorg07@gmail.com