def func(a, b, c, d):
...
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "тут xpath"))).click()
for k,v, in gl.items():
s=f'Group: {k}: \n'
avg_score = 0
for stdn,grds in v.items():
s+=f' {stdn}\t{grds[0]},{grds[1]},{grds[2]} \n'
avg_score += grds[0] + grds[1]+ grds[2]
s += f'avg_score: {round(avg_score / (len(v) * 3), 2)} \n'
print(s)
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "тут xpath"))).click()
driver.execute_script("window.scrollTo(0, y)")
# вот это
observation = weather = observation.get_weather()
# замени на это
weather = observation.weather
from itertools import groupby, chain
from collections import OrderedDict
a = [['Петров', 'Петр', 'Петрович', 'Стационар', '', '+7(888)888-88-88 ', ''],
['Иванов','Иван','Иванович','Поликлиника',
'','+7(777)777-77-77 доб.0000',''],
['Иванов', 'Андрей', '', '',''],
['Петров','Петр','Петрович','Стационар','Хирург','','',''],
['Иванов', 'Иван', '', '', '', 'Ivan.Ivanov@mail.ru']]
a.sort(key=lambda x: (x[0], x[1]))
grouped_list = [list(data) for _, data in groupby(a, key=lambda x: (x[0], x[1]))]
res = [list(OrderedDict.fromkeys(chain(*x))) for x in grouped_list]
pip install python-jose