>>109145801
>>109143207
import requests
from bs4 import BeautifulSoup
def decode_message(url):
# Get table from google doc html and extract text
html = requests.get(url).text
soup = BeautifulSoup(html, "html.parser")
lines = [
line.strip()
for line in soup.get_text("\n").splitlines()
if line.strip()
]
# Header row, hard-coded from google doc
start = None
for i in range(len(lines) - 2):
if (
lines[i] == "x-coordinate"
and lines[i + 1] == "Character"
and lines[i + 2] == "y-coordinate"
):
start = i + 3
break
if start is None:
raise ValueError("Could not find data table")
points = {}
max_x = max_y = 0
# Parse rows of (x, char, y) data
i = start
while i + 2 < len(lines):
try:
x = int(lines[i])
char = lines[i + 1]
y = int(lines[i + 2])
except ValueError:
break
points[(x, y)] = char
max_x = max(max_x, x)
max_y = max(max_y, y)
i += 3
# Fill empty spaces and assign characters
grid = [[" " for _ in range(max_x + 1)]
for _ in range(max_y + 1)]
for (x, y), char in points.items():
grid[y][x] = char
# Print each row
for row in reversed(grid):
print("".join(row))
decode_message(
"https://nigger_google_doc.com" # type the humiliation ritual google doc url here :)
)
I left the comments because they will ask you to explain your (((algorithm))), copy paste it as well because you won't pass anyway ;)