0% found this document useful (0 votes)
2 views8 pages

Daily Task-Operators

The document outlines a series of daily tasks focused on arithmetic, assignment, and comparison operators for students. It includes objectives, basic operations, and various exercises to apply these concepts in practical scenarios. Additionally, it covers topics like operator precedence, logical comparisons, and bitwise operators with specific questions to assess understanding.

Uploaded by

Kelu
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)
2 views8 pages

Daily Task-Operators

The document outlines a series of daily tasks focused on arithmetic, assignment, and comparison operators for students. It includes objectives, basic operations, and various exercises to apply these concepts in practical scenarios. Additionally, it covers topics like operator precedence, logical comparisons, and bitwise operators with specific questions to assess understanding.

Uploaded by

Kelu
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

Daily Task

Topics: Arithmetic • Assignment • Comparison Operators

🎯 Objective
By completing these tasks, students should be able to:

●​ Apply arithmetic operations in different contexts


●​ Use assignment operators effectively
●​ Use comparison operators for decision making
●​ Get introduced to magic methods (__add__, etc.)

1. Arithmetic (Basic)

Take two numbers as input and print:

●​ Addition
●​ Subtraction
●​ Multiplication
●​ Division
●​ Floor Division

2. Comparison (Basic)

Take two numbers as input and print:

●​ Are the two numbers equal


●​ Which number is greater
3. Assignment (Basic)
x = 10
x += 5
x *= 2
print(x)

→ What will be the output?​


→ Interpret(Explain) the output clearly

4. Operator Precedence

What will be the output?

print(10 + 5 * 2)
print((10 + 5) * 2)

→ Interpret (Explain) the output clearly.​


→ Explain the difference between the two outputs.

5. Mixed Expression

Take three numbers and calculate:

(a + b * c) - (a // b)

→ Explain the output in your own words.

6. Comparison Chain

What will be the output?

print(5 < 10 < 20)


→ Interpret the output step by step.

7. Logical Comparison
a = 15
b = 10
c = 20

Check the following:

●​ a is greater than b
●​ a is less than c

Print both results.

8. Salary Processing

Take salary as input:

●​ Add bonus → 10%


●​ Deduct tax → 8%

👉 Print final salary.

9. Exam Result System

Take marks of 3 subjects:

●​ Calculate average

👉 Print result

10. Travel Speed Check

Take distance and time:


●​ Calculate speed

👉 Print result.

11. E-commerce billing system

A customer buys 3 products.

Take input for:

●​ Price of Product 1
●​ Price of Product 2
●​ Price of Product 3

Apply the following rules:

●​ Product 1 → 15% discount


●​ Product 2 → 10% discount + 18% GST
●​ Product 3 → No discount + 12% GST

Additional Charges:

●​ Packaging fee → ₹50


●​ Delivery fee → ₹100

Final Requirement:

👉 Calculate and print:


1.​ Final price of each product after applying discount/GST
2.​ Total cost of all products
3.​ Add packaging + delivery charges
4.​ Print final amount to be paid

12. Content Filter


text = "machine learning with python"

Print True/False for:

●​ "python" exists
●​ "java" does not exist
13. ARITHMETIC OPERATORS with Mixed operators

Q1. John has 6 apples and 7 bananas. How many fruits does John have?

Q2. Emma read 15 pages yesterday and 10 pages today. Did she read more
than 20 pages in total?

Q3. Mike had 30 candies and gave 12 to his friend. How many does he have
now?

Q4. Sarah bought 5 pens at $3 each. How much did she spend?

Q5. There are 45 cookies equally divided among 5 kids. How many does each
get?

Q6. A chocolate costs $2. You have $9. Can you buy 5 chocolates?

Q7. Peter has 5 books, each weighing 1.2 kg. Is the total weight more than 6 kg?

Q8. A movie ticket costs $12. Can you buy 4 with $50?

Q9. Is the difference between 100 and 37 greater than 60?

Q10. Does dividing 81 by 9 result in a number greater than 8?

Q11. Are 5 multiplied by 6 and 30 equal?

Q12. A basket holds 18 apples. If you eat 6, do you have fewer than 15 left?

Q13. Sam travels 120 km in 2 hours. Is his speed 60 km/hr?

Q14. Is 7 + 3 * 2 equal to 20?

Q15. Jane bought 2 pens and 3 pencils. If a pen is $2 and pencil $1, did she
spend $9?

Q16. You have 3 boxes, each holding 12 balls. Are total balls more than 35?

Q17. Does subtracting 20 from 50 give 30?

Q18. Are 10 + 15 and 5 * 5 equal?


Q19. If a packet has 48 candies, can 6 kids get more than 7 each?

Q20. Multiply 4 by 4. Is the result less than 20?

Q21. Add 13 and 7. Is the result divisible by 5?

Q22. 20 apples are equally shared between 5 students. Does each get 4?

Q23. Subtract 15 from 60. Is the result equal to 45?

Q24. If you double 12, is the result more than 25?

Q25. Are 100 divided by 4 and 25 equal?

Q26. Add 5.5 and 4.5. Is the result 10?

Q27. A number is 25. If you divide it by 4 using floor division, is the result 6?

Q28. What is the remainder when 29 is divided by 5? Is it equal to 4?

Q29. Is 3 ** 4 equal to 81?

14. COMPARISON OPERATORS with Mixed operators

Q1. A bag contains 12 red balls and 8 blue balls. Is red > blue?

Q2. Tom scored 89 in math and 76 in science. Did he score more than 160 in
total?

Q3. A store sells apples at $2.50 each. If you buy 4, is the total cost more than
$10?

Q4. Alice has $100 and buys 3 books for $25 each. Will she have money left?

Q5. A rectangle has length 10 and width 4. Is area greater than perimeter?

Q6. Two friends have 45 and 55 marbles. Do they have equal marbles?

Q7. A car travels 60 km/hr and a bike 40 km/hr. Is the car faster?
Q8. Two numbers are 13 and 17. Is their sum an even number?

Q9. A triangle has sides 3, 4, 5. Is it right-angled?

Q10. Jenny had $50, bought items worth $35. Does she have less than $20 left?

15. LOGICAL OPERATORS

Q1. Given a = 10 and b = 5, is (a > 5 and b < 10) True?

Q2. If x = 8, is not (x > 10) True?

Q3. Is (5 < 3 or 7 == 7) True?

16. ASSIGNMENT OPERATORS

Q1. If x = 10 and x += 5, is new x equal to 15?

Q2. If y = 20 and y -= 7, is the result less than 15?

Q3. Given x = 12 and x *= 2, is x equal to 24?

17. BITWISE OPERATORS

Q1. If a = 6 and b = 3, is a & b equal to 2?

Q2. If a = 6 and b = 3, is a | b equal to 7?

Q3. If a = 6 and b = 3, is a ^ b equal to 5?

Q4. If a = 4, is ~a equal to −5?


Q5. If a = 5, is a << 1 equal to 10?

Q6. If a = 8, is a >> 2 equal to 2? .

Q7. If p = 10 and q = 10, does p is q return True?

Q8. If x = 500 and y = 500, does x is y return True?​

Q9. If name = "Rahul", does "R" in name return True?

Q10. If message = "hello", does "H" in message return True?​

Q11. If word = "coding", does "code" in word return True?​

Q12. If a = True and b = True, does a is b return True?

Q13. If username = "admin", does "Admin" in username return True?

You might also like