Есть такое понятие как Switch Statement. Это некоторая конструкция в языке программирования предназначенная для множественного ветвления алгоритма.
вот примеры реализаций в разных языках:
JavaScrpt
C++ (или здесь)
C#
Ruby
PHP
Go
Delphi
и даже Pascal
В целом, шаблон такой:
switch query:
case match1:
...
case match1:
...
А что у нас в Python?
if condition1:
...
elif condition2:
...
elif condition2:
...
else:
...
Вполне рабочий вариант. Но явно отличается от примеров выше.
И тут внезапно!!! 23 июня 2020г выходит в свет PEP622
И что мы видим? Планы на Python 3.10 по добавлению Switch Statement! Называется он Structural Pattern Matching, но по сути мы получаем тот же синтаксис что и в Switch Statement.
match some_expression:
case pattern_1:
...
case pattern_2:
...
В данный момент статус его еще Draft. Интересно как он еще изменится и доживет ли концепция до релиза? Учитывая что один из автором сам Guido van Rossum, можно сказать что внедрят точно!
Пока рано его разбирать, просто подождем...
#pep
#CITY/USDT analysis :
#CITY has broken out and retested the 200 Exponential Moving Average (EMA). It is currently consolidating above the 200 EMA. The price is expected to bounce back from this level and resume its upward momentum to test higher levels.
TF : 1H
Entry : $1.107
Target : $1.160
SL : $1.075
#CITY/USDT analysis :
#CITY is currently in a downtrend, establishing new lows. The price is anticipated to retest the resistance zone before potentially reversing from there to resume bearish momentum and test lower levels.
TF : 4h
Entry : $1.220
Target : $1.083
SL : $1.300
#CITY/USDT analysis :
#CITY has broken below the support levels, forming lower lows (LLs) and lower highs (LHs) while trading below the 200 EMA. The price is expected to maintain its bearish momentum and test lower levels.
TF : 2H
Entry : $1.826
Target : $1.715
SL : $1.903
#CITY/USDT analysis :
#CITY is presently in a downtrend, trading below the 200 EMA. The price is currently consolidating above support levels. It is expected to be breached by the price soon and will continue its bearish momentum on lower time frames to test previous lows. Wait for a break of the $1.945 level to initiate a short position.
TF : 1H
Entry : $1.945
Target : $1.853
SL : $2.005