Max() function problem

list = ['123', '49']
x = max(list)

output>> '49'

For the arithmetic arranger, I’m making use of the max() method to set the length of white-spaces and hyphens.

#regex_eq is the exact same list as the first line of this post
row_three += '{}'.format('-'*(len(max(regex_eq))+2)) + '    '

This works except for those set of numbers. Why is that? And any workarounds??

list is a keyword in Python. You should not use it as a variable name.
In the example that you have given,['123', '49'], the data is in str format. You might want to convert the string to integer using int('123').

That was just an example. In my actual code, the variable of that list is called regex_eq .
My question is why doesn’t it work on that values ['123', '49'] but works fine on ["32 ", "698"], ["1", " 3801"], [ "45", "43"]

Just a lucky examples. String comparison in python works in a way that it compares character pairs, starting from the left, one-by-one and only if they are the same the further pair is checked.
That’s why '123' < '49' as '1' < '4'. For other examples it’s just luck that comparing them as string results in the same answer, as when they would be compared as integers.