>>> check = ['X', 'H', 'e', 'V', 'm', 'l', 's', 1, 0, 'y', 'j', 'b', 'g', 'o',
'R', 'U', 'O', 'p', 'p', 8, 'Y', 'B', 'Y', 'O', 'r', 'E', 't', 'I',
'w', 'i', 'v', 'o', 2, 'd', 'Z', 'b', 'S', 'T', 'n', 0]
# приводим к единому регистру
>>> check_low = [i.lower() if isinstance(i, str) else i for i in check]
>>> from collections import Counter
# считаем число вхождений элементов и результат приводим для удобства к списку кортежей
>>> check_pair = Counter(check_low).most_common()
# убираем уникальные
>>> check_pair = [(x, y) for (x, y) in check_pair if y != 1]
# создаем словарь
>>> check_dict = dict(check_pair)
>>> check_dict
{0: 2, 'y': 3, 'b': 3, 'v': 2, 't': 2, 'o': 4, 'p': 2, 'r': 2, 'e': 2, 'i': 2, 's': 2}
variant = int(input("= "))
actdam = {'1': self.damagetohead, '2': self.damagetobody, '3': self.damagetoheand, '4': self.damagetolegs}
Я недавно переустановил Windows
переустановил Windows
Windows
<a href="/recipes/~5/">5</a>
<div class="paginator">
, можете поиском найти.<div class="paginator_conteyner">
<div id="p_clone" style="width:100%">
<div class="paginator" id="paginator_0" style="width:100%"><table width="100%"><tbody><tr><td width="7.142857142857143%"><span><strong>1</strong></span></td><td width="7.142857142857143%"><span><a href="/recipes/~2/">2</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~3/">3</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~4/">4</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~5/">5</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~6/">6</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~7/">7</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~8/">8</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~9/">9</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~10/">10</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~11/">11</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~12/">12</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~13/">13</a></span></td><td width="7.142857142857143%"><span><a href="/recipes/~14/">14</a></span></td></tr><tr><td colspan="14"><div class="scroll_bar"><div class="scroll_trough"></div><div class="scroll_thumb" style="width: 8px; left: 0px;"><div class="scroll_knob"></div></div><div class="current_page_mark" style="width: 3px; left: -1.5px;"></div></div></td></tr></tbody></table></div>
<div class="paginator_pages" style="width:100%"></div>
</div>
</div>
//div[@itemprop="recipe-ing"]/li[@class="cat"]/span/@name
spans = soup.find_all('span', attrs={"itemprop": "name"})
for span in spans:
print(span.get_text())
lists = soup.find_all("li","cat")
for li in lists:
spans = li.find_all(attrs={"itemprop": "name"})
for span in spans:
print(span.get_text())
TRANSLIT = {'А': 'A',
'Б': 'B',
'В': 'V',
'Г': 'G',
'Д': 'D',
'Е': 'E',
'Ё': 'YO',
'Ж': 'ZH',
'З': 'Z',
'И': 'EE',
'Й': 'J',
'К': 'K',
'Л': 'L',
'М': 'M',
'Н': 'N',
'О': 'O',
'П': 'P',
'Р': 'R',
'С': 'S',
'Т': 'T',
'У': 'U',
'Ф': 'F',
'Х': 'H',
'Ц': 'C',
'Ч': 'CH',
'Ш': 'SH',
'Щ': 'SCH',
'Ъ': '',
'Ы': 'I',
'Ь': '',
'Э': 'E',
'Ю': 'U',
'Я': 'YA'}
def translit(text):
result = []
for c in text:
result.append(TRANSLIT.get(c.upper(), c))
return ''.join(result)