math functions with non numeric args

A

Andrew Z

Hello,

print max(-10, 10)
10
print max('-10', 10)
-10

My guess max converts string to number bye decoding each of the characters
to it's ASCII equivalent?

Where can i read more on exactly how the situations like these are dealt
with?

Thank you
AZ
 
I

Irmen de Jong

Hello,

print max(-10, 10)
10
print max('-10', 10)
-10

My guess max converts string to number bye decoding each of the characters to it's ASCII
equivalent?

Where can i read more on exactly how the situations like these are dealt with?

Thank you
AZ

Use Python 3.x instead.
Traceback (most recent call last):


Irmen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top