0
23.(i) What is the output of the following code snippet? a = [ 'Region',[1,2,3,4]] print(a[0][2],end=' ') print(a[1][3])
Python programming
4 Réponses
+ 2
Run it in the code playground to find out.
+ 1
😁
+ 1
a = [ 'Region', [ 1, 2, 3, 4 ] ]
a[ 0 ] = 'Region'
It's a string of 6 characters
a[ 0 ] [ 2 ] = 'g'
+ Remember index begins at zero
a[ 1 ] = [ 1, 2, 3, 4 ]
It's a list of 4 integers
a[ 1 ][ 3 ] = 4
+ Remember index begins at zero
Next time ask for explanation, not "what is the output". You can simply run the snippet anywhere to see the output.
P.S. And please use the tags to specify a language relevant to your question.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 1
Okay guys