0% found this document useful (0 votes)
6 views3 pages

Python Operator Questions: Basic to Advanced

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)
6 views3 pages

Python Operator Questions: Basic to Advanced

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

Python Operator-Based Questions (Basic to Advanced)

1. Add two numbers and display the result.

2. Subtract two numbers entered by the user.

3. Multiply two floating point numbers.

4. Divide one number by another and print the quotient.

5. Find the remainder using modulus operator.

6. Calculate area of a triangle using basic arithmetic.

7. Compute power using ** operator.

8. Find simple interest (P × R × T / 100).

9. Convert Celsius to Fahrenheit using formula.

10. Calculate the perimeter of a rectangle.

11. Check if two numbers are equal.

12. Compare two ages and find who is older.

13. Check if a number is greater than 100.

14. Determine if a number is positive, negative, or zero.

15. Check if a number is within a specific range (e.g., 1050).

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

17. Validate if a person is eligible to vote (age 18).

18. Check if a number lies outside a given range.

19. Check if at least one condition among two is true.

20. Use not operator to flip a boolean value.

21. Demonstrate use of +=, -=, *=, /= on a variable.

22. Update a salary value with 10% bonus using assignment operator.

23. Calculate net marks by subtracting penalty using -=.

24. Perform bitwise AND on two integers.

25. Perform bitwise OR on two integers.


26. Perform bitwise XOR on two integers.

27. Find bitwise NOT of a number.

28. Left shift a number by 2 bits.

29. Right shift a number by 3 bits.

30. Check if two variables point to the same object using is.

31. Show difference between is and == using lists.

32. Check if two strings are not the same object.

33. Check if an element exists in a list.

34. Check if a letter is present in a string.

35. Verify if a number is not in a tuple.

36. Build a basic calculator using all arithmetic operators.

37. Take a number and check multiple conditions using logical and comparison operators.

38. Swap two numbers using arithmetic operators.

39. Validate user login using identity and logical operators.

40. Create a grade calculator using relational and assignment operators.

41. Calculate EMI for a loan.

42. Convert seconds into hours, minutes, and seconds.

43. Find the roots of a quadratic equation.

44. Calculate average marks and determine pass/fail.

45. Calculate area of different shapes using user choice.

46. Check if a year is a leap year.

47. Find the greatest of three numbers.

48. Determine if a character is a vowel or consonant.

49. Validate if password length and characters are valid.

50. Check eligibility for admission based on multiple conditions.

51. Check whether a number is even or odd using bitwise AND.

52. Swap numbers using XOR (bitwise trick).


53. Count number of 1s in binary of a number.

54. Toggle bits of a number.

55. Bill calculator (electricity, mobile recharge etc.).

56. Discount calculator with conditions (e.g., if purchase > 1000 10% off).

57. GST calculator.

58. BMI calculator.

59. Currency converter (basic fixed rate).

60. Mini ATM simulator (withdrawal, check balance).

61. User login system (with identity and comparison).

62. Smart calculator using if-else (user selects operator).

63. Ticket price calculator (age-based: child, adult, senior).

64. Result system (take marks of 5 subjects and give grade using logical + relational).

You might also like