1.

Which of the following is the truncation division operator?(a) /(b) %(c) //(d) |I got this question in an online interview.The above asked question is from Precedence and Associativity topic in portion Precedence and Associativity, Bitwise & Boolean of Python

Answer»

Right option is (c) //

To explain: // is the operator for TRUNCATION division. It is called so because it returns only the integer part of the quotient, TRUNCATING the decimal part. For EXAMPLE: 20//3 = 6.



Discussion

No Comment Found

Related InterviewSolutions