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, iv
Question
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, iv
Solution
The question seems to be a bit confusing, but I'll try to interpret it as best as I can.
(i) 42//2 = 21 (This is integer division in Python, which means it will return the largest whole number)
(ii) 21%6 = 3 (This is the modulus operation in Python, which returns the remainder of the division)
(iii) 12/4 = 3.0 (This is regular division in Python, which returns a float)
(iv) 11*2 = 22 (This is multiplication in Python)
So, the pairs that will give the same result are (ii) and (iii).
Similar Questions
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
For which of the following is m= 8? I. (5m � 5-3) / 52 = 53 II. -(5m � 5-3) / 53 = 52 III. (5m � 53) / 52 = 53 IV. (5 � 5-2) / 52 = 53
Which of the following is correct regarding the ion shown below?Group of answer choices
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
(I) (II) (III) (IV) In which of the following beakers colour change of solution will take place after reaction?Only III and IIIOnly IVIII and 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.