0% found this document useful (0 votes)
38 views2 pages

Python Logical Operators Practice Class11

Uploaded by

Sharan JR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Python Logical Operators Practice Class11

Uploaded by

Sharan JR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

50 Python Practice Questions: and / or (Class 11)

Part A: Predict the Output (20 Questions)

1. print(5 > 3 and 8 < 10)

2. print(4 == 4 and 6 != 6)

3. print(3 >= 3 or 2 > 5)

4. print(False and True)

5. print(True or False)

6. print(10 < 20 and 20 < 30)

7. print(15 == 15 or 15 != 15)

8. print(7 > 10 and 8 < 15)

9. print(12 != 10 or 5 > 9)

10. print(8 > 5 and 4 < 2)

11. print(a = 6; b = 3; print(a > b and b > 2))

12. print(x = 10; print(x > 5 or x < 5))

13. print(y = 4; print(y == 4 and y != 4))

14. print((4 < 6) and (2 > 1))

15. print((3 == 3) or (4 == 5))

16. print((7 > 8) and (6 < 7))

17. print((10 <= 10) or (9 >= 11))

18. print(True and False and True)

19. print(False or False or True)

20. print(a = 9; b = 2; print(a % b == 1 and b < 5))

Part B: Fill in the Blank with and/or (10 Questions)

21. print(6 < 9 ___ 3 < 4)

22. print(5 != 5 ___ 8 > 7)

23. print(a = 4; b = 4; print(a == b ___ b > 2))

24. print(9 == 8 ___ 3 <= 3)

25. print(x = 12; print(x > 10 ___ x < 5))

26. print(False ___ True)

27. print(True ___ False)

28. print(a = 1; b = 2; print(a > b ___ a != b))


50 Python Practice Questions: and / or (Class 11)

29. print(7 < 6 ___ 8 < 9)

30. print((4 > 2) ___ (1 > 10))

Part C: Write Python Code Using and/or (10 Questions)

31. Write a program to check if a number is between 1 and 100 (inclusive) using and.

32. Write a program that takes a number and prints 'Multiple of 3 or 7' if divisible by 3 or 7.

33. Check if a person can get a driver's license (age >= 18 and eyesight is good).

34. Write a program to check if a number is positive and odd.

35. Input two numbers and check if either is a multiple of 10.

36. Print 'In range' if a number is between 50 and 500 (inclusive), else 'Out of range'.

37. Check if a student is failing (Math < 33 or Science < 33).

38. Check if a year is not divisible by 100 or divisible by 400.

39. Print 'Eligible' if the user is female or over 60 years old.

40. Check whether a number is not between 10 and 20 using or.

Part D: More Code-Writing Practice (10 Questions)

41. Check if a number is positive and even.

42. Check if a number is divisible by both 3 and 5.

43. Check if a person is eligible to vote (age >= 18 and Indian citizen).

44. Check if a year is a leap year (use logical operators).

45. Check if a number is negative or zero.

46. Check if a student passed (marks > 33 in both subjects).

47. Check if a letter is a vowel (a, e, i, o, u).

48. Check if either of the two numbers is greater than 100.

49. Print 'Valid' if age is between 13 and 19 inclusive.

50. Check if a character is a digit or a lowercase letter.

You might also like