DEV Community

Discussion on: Sum of Two Integers without Arithmetic operators

Collapse
 
matthewsalerno profile image
matthew-salerno

A friend of mine and I tried writing some simple functions in python without using any arithmetic operators or numeric literals. It was pretty fun, mostly boiled down to taking the length of lists of empty lists and other objectively cursed things. It was still a fun exercise though and definitely worth trying. I like your approach of using logic operators, although it still seems a little too close to normal addition to me. The log method was really neat and definitely not something I would have thought of.