t402.py 425 B

12345678910111213141516171819202122
  1. print "EVALUATE TO TRUE:"
  2. # list
  3. print all([True,1,5.0,-33L,'hello',(3,4,5),[-6,7,10.0],{17:'true',-11L:True}])
  4. # str
  5. print all('hello')
  6. print all('false')
  7. print all('')
  8. # tuple
  9. print all((3,4,5))
  10. print all((3,4,))
  11. print all(())
  12. # dict
  13. print all({1:10,-2:'hello',13L:'false',(2,3):True})
  14. print all({})
  15. print "EVALUATE TO FALSE:"
  16. # list
  17. print all([0,False,1,True])
  18. # tuple
  19. print all((1,0))
  20. # dict
  21. print all({0:True,1:False})