KnowledgeBoat Logo

Computer Science

What will the result given by the following?

(a) type (6 + 3)

(b) type (6 -3)

(c) type (6 *3)

(d) type (6 / 3)

(e) type (6 // 3)

(f) type (6 % 3)

Python Data Handling

38 Likes

Answer

(a) type (6 + 3)
⇒ int + int
⇒ int
So the result is int.

(b) type (6 -3)
⇒ int - int
⇒ int
So the result is int.

(c) type (6 * 3)
⇒ int * int
⇒ int
So the result is int.

(d) type (6 / 3)
⇒ int / int
⇒ float
So the result is float.

(e) type (6 // 3)
⇒ int // int
⇒ int
So the result is int.

(f) type (6 % 3)
⇒ int % int
⇒ int
So the result is int.

Answered By

22 Likes


Related Questions