Inside a for loop I have an if statement with a nested if statement inside. then I have 11 elif statements for the outer if statement all with nested if statements inside.
For example:
coins = ['USDT', 'BTC', 'ALPINE', 'USDT']
for i in range(len(coins) - 1):
first = coins[I]
second = coins[i + 1]
if first == 'USDT':
if second != 'BUSD' or 'USDC':
print('elif Number 1')
elif first == 'USDT':
if second == 'BUSD' or 'USDC':
print('elif Number 2')
elif first != 'USDT' or 'BTC' or 'ETH' or 'BNB' or 'BUSD' or 'USDC':
if second == 'BTC' or 'ETH' or 'BNB' or 'BUSD' or 'USDC':
print('elif Number 3')
The first iteration of the loop works as intended.
With
first = 'USDT
second = "BTC
The first if statement is used and the outcome is
elif number 1
The second iteration of the loop doesn't work.
first = 'BTC'
second = 'ALPINE'
The outcome is elif number 3
which is wrong and the elif statements should filter it into a different outcome.
I have a bunch more elif statements to cover all possible outcomes but it is not being filtered correctly.
What am I missing here?