@mikael
Max - variable count to, for example 100.
So i need count quantity uniques examples for some mathematic operator, in my case '+' or '-'
I can't have example 98+10 or 25-50
Max example result must be under 100 or equal
Minimum example result must be under 0
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Best posts made by lyubomyr83
-
RE: Function for recognize quantity of unique combinations
-
Function for recognize quantity of unique combinations
Hello pythonista community. Can someone adwise me formula for recognize quantity of unique combinations when you count to some max digit with sign "-" (minus)? Answer can't be under zero.
Example1:
sign = '-'
max = 2
2-2
2-1
1-1- we have only three unique combinations.
Example2:
answer can't be upper max:
max = 2
1+1- we have only one unique example.
I already have formula for two signs "+-": unic_col=max**2
But i need formula for '+' and '-'
And maybe someone know for:
+-×
+-/
+-×/
/×So, i need function like that:
def uniques_col(operators, max):
if operators == '+-':
return max**2
elif operators == '+':
return .....
elif operators == '-':
return .....
elif operators == '+-×':
return .....
......