Put float switch in glass of water and check results again.
When float switch is up, serial monitor will print "1" and when float is down it will print "0".
If this is not the case, you can do a little trick. There is a little ring on float end. Take it off and rotate the floating part upside down. Put ring again to secure float switch and test results again.