Aug-08-2018, 02:30 AM
how can i have a single simple expression convert an object to an int or raise an exception only if it cannot be converted to an int? valid objects include floats, decimal.Decimal, and strings of numbers in some base specified by its prefix. int(s) assumes decimal unless coded as int(s,0) but then if s is a float it raises an exception. i just want the whole part of the real part of anything Python can convert to a number by any means.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.