-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.py
More file actions
24 lines (23 loc) · 722 Bytes
/
Copy pathgame.py
File metadata and controls
24 lines (23 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# pylint: disable=missing-docstring
# pylint: disable=too-few-public-methods
import string
import random
import requests
class Game:
"""Form a complex number."""
def __init__(self):
"""Form a complex number."""
self.grid = []
for _ in range(9):
self.grid.append(random.choice(string.ascii_uppercase))
def is_valid(self,word):
"""Form a complex number."""
if len(word) <= 0:
return False
for i in word:
test = i in self.grid
requete = requests.get(f'https://wagon-dictionary.herokuapp.com/{word}')
found = requete.json()['found']
if test and found is True:
return True
return False