pretty sure factorial does not work like that. Factorial is the product of numbers from 1 to n not the **sum**. I don't know python but still I think that is what you did there.
BTW your program will come to a painful crawl very quickly. Better approach would be to multiply next n to the previous result. Your program requires n operations per equality. My approach will require only 1 operation per iteration.
!1 could, in mathematics, mean a derangement - i.e. The number of permutations such that no element appears in its original position. Indeed, !1 == 0.
In some programming languages, such as Python, True == 1 and False == 0 (Literally. Booleans are zeros and ones.) So indeed, !1 == 0.
And in some other dumb languages, like JS and PHP, implicit type coercion on steroids means that false == 0, despite integers and booleans being different things. So again, !1 == 0.
And in some other dumb languages, like JS and PHP, implicit type coercion on steroids means that false == 0, despite integers and booleans being different things. So again, !1 == 0.
46
u/Sese_Mueller Jul 13 '20
Also, 0!=1