block['tags'] = [tag.text for tag in soup.find_all('a', {'class': 'a-cats__link'})]
block['tags'] = soup.find('a', {'class': 'a-cats__link'}).text
for tag in block['tags']:
def find_max_period(arr):
for i in range(3, len(arr)//2+1):
def find_max_period(arr):
for i in range(len(arr)//2, 1, -1):
sentences = [['in', 'comparison', 'to', 'dogs', 'cats', 'have', 'not', 'undergone', 'major', 'changes', 'during', 'the', 'domestication', 'process'], ['as', 'cat', 'simply', 'catenates', 'streams', 'of', 'bytes']]
unique_words = ['in', 'comparison', 'to', 'dogs', 'cats', 'have', 'not', 'undergone', 'major', 'changes', 'during', 'the', 'domestication', 'process', 'as', 'cat', 'simply', 'catenates', 'streams', 'of', 'bytes']
result = [[sentence.count(word) for word in unique_words] for sentence in sentences]
print(result)
# [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1]]
x = c.execute('''SELECT role FROM users
WHERE login = ? AND pas = ?''', (a, b)).fetchone()
# если такая запись есть, сразу получаем роль
if x:
c = x[0]
# здесь как раз будет 'admin' или другое значение
else:
# записи не найдено, значит логин+пароль не совпал
while b <= c:
con = sqlite3.connect("dannie_2.db")
cur = con.cursor()
cur.execute(f"SELECT id, name, balance FROM users")
users = cur.fetchall()
a = str(users[-b])
message(message.chat.id,text=a)
b = b+1
con = sqlite3.connect("dannie_2.db")
cur = con.cursor()
cur.execute(f"SELECT id, name, balance FROM users")
users = cur.fetchall()
for user in users:
message(message.chat.id,text=str(user))
cur.execute(f"SELECT id, name, balance FROM users order by id desc")
type conf
выводит содержимое?