Write the output of the given Python code: print (3 – 4) print (3 * 4) print (4/3) print (3 % 2) print (3**4) print (3 // 4)
Answers
Answered by
5
print(3 - 4) = -1
print(3 * 4) = 12
print(4 / 3) = 1.3333333333333333
print(3 % 2) = 1
print(3 ** 4) = 81
print(3 // 4) = 0
Answered by
42
1. >>> print(3 - 4)
- -1
2. >>> print(3*4)
- 12
3. >>>print(4/3)
- 1.33333333333
4. >>>print(3%2)
- 1
5. >>> print(3**4)
- 81
6. >>> print(3//4)
- 0
The last three operations might seem new.
- % - modulus: returns only the remainder after division.
- ** - exponentiation: performs exponential calculation.
- // - floor division: returns only the quotient after division.
For instance,
>>> 5%2 #remainder when 5 is divided by two:
1
>>> 5**2 #equivalent to 5*5
25
>>> 5//2 #quotient when 5 is divided by two:
2
Similar questions