Post

Muhammad Hunain
Muhammad Hunain@Hunain_5698·
@Python_Dv Tuple[3] means element at index position 3 which is (5), Because the index starts from 0 Now print (5) will give 5 because in python (5) is treated as integer while (5,) treated as tuple So, B is the right answer
English
1
1
7
506
Kode Gurukul
Kode Gurukul@kodegurukul·
Tricky. Answer is 5 It is simply accessing element at index 3 of tuple, which is 5. The variable is named as tuple may confuse someone, but here it is simply acting as a normal variable.
Kode Gurukul tweet media
English
1
0
3
238
Prem Prakash
Prem Prakash@4EverPrem·
@Python_Dv 5. Python uses zero based index. Tuple[3] => element at third 3 index=> 5
English
0
0
1
290
@Anu
@Anu@anutechie3·
@Python_Dv Confused between C and B
English
0
0
0
15
Rakesh Das
Rakesh Das@RakeshDas_18·
@Python_Dv B. 5 is the answer. Reason: The tuple contains five elements: 1 2 [3, 4] (5) {6,7,8} (which is invalid syntax) When we access tuple[3], we get the fourth element, which is (5) (a single-element tuple). Therefore, the output is 5
English
0
0
0
16
Endymion-X
Endymion-X@Endymion_X·
@Python_Dv The output will be 5. But interesting is that if You write: print(Tuple[4]), the output will show {8,6,7} instead of {6,7,8}. Why?
English
0
0
0
76
Paylaş