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?(i) 42//2(ii) 21%6(iii) 12/4(iv) 11*2ii,iiii, iiiii, iviii, i
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
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
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 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
An element of atomic number 15 will be expected to form I ionic compounds II covalent compounds III an acidic oxide AI, II and IIIBI and II onlyCII and III only DII only
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.