Skip to content
Snippets Groups Projects
Select Git revision
  • 5f7e8dc176661b49e12a0d8425101799ff176d19
  • wip-bootstrap default
  • dualcore
  • ch3/leds
  • ch3/time
  • master
6 results

string1.py

Blame
  • logic_constfolding.py 442 B
    # tests logical constant folding in parser
    
    def f_true():
        print('f_true')
        return True
    
    def f_false():
        print('f_false')
        return False
    
    print(0 or False)
    print(1 or foo)
    print(f_false() or 1 or foo)
    print(f_false() or 1 or f_true())
    
    print(0 and foo)
    print(1 and True)
    print(f_true() and 0 and foo)
    print(f_true() and 1 and f_false())
    
    print(not 0)
    print(not False)
    print(not 1)
    print(not True)
    print(not not 0)
    print(not not 1)