Python : Conditional Statement Test 7

 

 

Python : Conditional Statement Test 7


Q1. Evaluate the following statements:

 

a=True

b=True

c=True

d=True

 

1.          print(c)
2.          print(d)
3.          print(not a)
4.          print(not b )
5.          print(not c )
6.          print(not d)
7.          print(a and b )
8.          print(a or b )
9.          print(a and c)
10.       print(a or c )
11.       print(a and d )
12.       print(a or d)
13.       print(b and c )
14.       print(b or c )
15.       print(a and b or c)
16.       print(a or b and c )
17.       print(a and b and c)
18.       print(a or b or c )
19.       print(not a and b and c)
20.       print(not a or b or c )
21.       print(not (a and b and c))
22.       print(not (a or b or c) )
23.       print(not a and not b and not c)
24.       print(not a or not b or not c )
25.       print(not (not a or not b or not c))

SOLUTIONS
 
  1.  True
  2. True
  3. False
  4. False
  5. False
  6. False
  7. True
  8. True
  9. True
  10. True
  11. True
  12. True
  13. True
  14. True
  15. True
  16. True
  17. True
  18. True
  19. False
  20. True
  21. False
  22. False
  23. False
  24. False
  25. True

No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet