Which of the following two will give the same result?(i) 42//2(ii) 21%6(iii) 12/4(iv) 11*2ii,iiii, iiiii, iviii, i
Question
Which of the following two will give the same result?
42//2
21%6
12/4
11*2
Select two options from:
- ii
- iii
- i
- iv
Solution
The question seems to be a bit confusing, but I'll try to answer it based on my understanding.
(i) 42//2 = 21 (This is integer division in Python, which gives the largest whole number less than or equal to the division)
(ii) 21%6 = 3 (This is the modulus operation in Python, which gives the remainder of the division)
(iii) 12/4 = 3.0 (This is float division in Python, which gives the exact quotient)
(iv) 11*2 = 22 (This is multiplication in Python)
So, the pairs that will give the same result are (ii) and (iii). The other pairs will not give the same result.
Similar Questions
Which of the following two will give the same result?(i) 42//2(ii) 21%6(iii) 12/4(iv) 11*2ii,iiii, iiiii, iviii, i
Compare acidic strength of following ?A I > II > III > IV B IV > III > I > II C III > IV > II > I D IV > I > III > II
Which one of the following is the real part of the complex number: 6(2-3i)?A.2B.12C.-3D.6
Assume y be an array. Which of the following operations are incorrect?I. ++yII. y+1III. y++IV. y*2a.I and IIb.I, II and IIIc.II and IIId.I, III and IV
Complex I in the ETC passes electrons to Group of answer choicesComplex IIComplex IIIUbiquinoneeither Complex II or UbiquinoneComplex IV
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.