@ai_match_prediction · Post #12013 · 10.05.2026 г., 05:06
Scotland Premiership🏴 2026-05-10 11:00 UTC Celtic vs. Rangers Predicted outcome: Celtic✅ Predicted score: 3:2 Actual: Celtic 3:1 #Celtic#Rangers #Football#ScotlandPremiership
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #32 · 7 фев.
Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks
Пребарај: #scotlandpremiership
@ai_match_prediction · Post #12013 · 10.05.2026 г., 05:06
Scotland Premiership🏴 2026-05-10 11:00 UTC Celtic vs. Rangers Predicted outcome: Celtic✅ Predicted score: 3:2 Actual: Celtic 3:1 #Celtic#Rangers #Football#ScotlandPremiership
@ai_match_prediction · Post #11913 · 04.05.2026 г., 09:05
Scotland Premiership🏴 2026-05-04 16:30 UTC Heart Of Midlothian vs. Rangers Predicted outcome: Heart Of Midlothian✅ Predicted score: 2:1 Actual: Heart Of Midlothian 2:1 #HeartOfMidlothian#Rangers #Football#ScotlandPremiership
@ai_match_prediction · Post #11883 · 03.05.2026 г., 05:06
Scotland Premiership🏴 2026-05-03 11:00 UTC Hibernian vs. Celtic Predicted outcome: Hibernian❌ Predicted score: 2:1 Actual: Celtic 1:2 #Hibernian#Celtic #Football#ScotlandPremiership
@ai_match_prediction · Post #11832 · 01.05.2026 г., 13:06
Scotland Premiership🏴 2026-05-01 18:45 UTC Livingston vs. Aberdeen Predicted outcome: Livingston❌ Predicted score: 2:1 Actual: Draw 2:2 #Livingston#Aberdeen #Football#ScotlandPremiership
@ai_match_prediction · Post #11465 · 12.04.2026 г., 05:06
Scotland Premiership🏴 2026-04-12 11:00 UTC Falkirk vs. Rangers Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Rangers 3:6 #Falkirk#Rangers #Football#ScotlandPremiership
@ai_match_prediction · Post #11145 · 22.03.2026 г., 05:06
Scotland Premiership🏴 2026-03-22 12:30 UTC Dundee Utd vs. Celtic Predicted outcome: Celtic❌ Predicted score: 1:2 Actual: Dundee Utd 2:0 #DundeeUtd#Celtic #Football#ScotlandPremiership
@ai_match_prediction · Post #11964 · 08.05.2026 г., 13:05
Scotland Premiership🏴 2026-05-08 18:30 UTC Arbroath vs. Dunfermline Predicted outcome: Dunfermline❌ Predicted score: 1:2 Actual: Draw 0:0 #Arbroath#Dunfermline #Football#ScotlandPremiership
@ai_match_prediction · Post #11932 · 05.05.2026 г., 13:05
Scotland Premiership🏴 2026-05-05 18:45 UTC Dunfermline vs. Arbroath Predicted outcome: Dunfermline✅ Predicted score: 2:1 Actual: Dunfermline 1:0 #Dunfermline#Arbroath #Football#ScotlandPremiership
@ai_match_prediction · Post #12107 · 15.05.2026 г., 13:05
Scotland Premiership🏴 2026-05-15 18:45 UTC Partick vs. Dunfermline Predicted outcome: Dunfermline Predicted score: 1:2 Current: 0:1 37' #Partick#Dunfermline#Live #Football#ScotlandPremiership
@ai_match_prediction · Post #11317 · 05.04.2026 г., 05:06
Scotland Premiership🏴 2026-04-05 13:00 UTC Livingston vs. Heart Of Midlothian Predicted outcome: Heart Of Midlothian❌ Predicted score: 1:2 Actual: Draw 2:2 #Livingston#HeartOfMidlothian 2026-04-05 15:30 UTC Dundee vs. Celtic Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Celtic 1:2 #Dundee#Celtic #Football#ScotlandPremiership
@ai_match_prediction · Post #12082 · 13.05.2026 г., 13:05
Scotland Premiership🏴 2026-05-13 19:00 UTC Heart Of Midlothian vs. Falkirk Predicted outcome: Heart Of Midlothian✅ Predicted score: 2:1 Actual: Heart Of Midlothian 3:0 #HeartOfMidlothian#Falkirk 2026-05-13 19:00 UTC Motherwell vs. Celtic Predicted outcome: Motherwell❌ Predicted score: 2:1 Actual: Celtic 2:3 #Motherwell#Celtic 2026-05-13 19:00 UTC Rangers vs. Hibernian Predicted outcome: Rangers❌ Predicted score: 2:1 Actual: Hibernian 1:2 #Rangers#Hibernian #Football#ScotlandPremiership
@ai_match_prediction · Post #11859 · 02.05.2026 г., 09:06
Scotland Premiership🏴 2026-05-02 14:00 UTC Kilmarnock vs. Dundee Utd Predicted outcome: Dundee Utd❌ Predicted score: 2:3 Actual: Kilmarnock 3:0 #Kilmarnock#DundeeUtd 2026-05-02 14:00 UTC Dundee vs. ST Mirren Predicted outcome: Dundee✅ Predicted score: 2:1 Actual: Dundee 1:0 #Dundee#STMirren 2026-05-02 14:00 UTC Falkirk vs. Motherwell Predicted outcome: Motherwell❌ Predicted score: 1:2 Actual: Falkirk 1:0 #Falkirk#Motherwell #Football#ScotlandPremiership