English

Give the output of the following when num1 = 4, num2 = 3, num3 = 2. print(10 + 6 * 2 ** 2 != 9 // 4 - 3 and 29 >= 29/9) - Computer Science (Python)

Advertisements
Advertisements

Question

Give the output of the following when num1 = 4, num2 = 3, num3 = 2.

print(10 + 6 * 2 ** 2 != 9 // 4 - 3 and 29 >= 29/9)

Short/Brief Note
Advertisements

Solution

print(10 + 6 * 2 ** 2 != 9//4 - 3 and 29 >= 29/9)
Taking the above statement into two separate parts.

LHS:
10 + 6 * 2 ** 2 != 9//4 - 3
10 + 6 * 4 != 2 - 3
10 + 24 != -1
34 != -1
True

RHS:
29 >= 29/9
True

Now the complete equation can be written as
print(True and True)
Therefore, the output will be 'True'.

shaalaa.com
Operators - Arithmetic Operators (-,+,*,/,%)
  Is there an error in this question or solution?
Chapter 5: Getting Started with Python - Exercise [Page 117]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 5 Getting Started with Python
Exercise | Q 7. l) | Page 117
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×