0
What is the output of the following code?
Shiv={11,5,7,7,2} Shiv=str(Shiv) print(Shiv[2])
2 Answers
+ 8
shiv=(11,5,7,2,2)
you convert tuple into a string - str(shiv) - you just need to add ââ at the beginning and at the end of a tuple.
So str(shiv)==â(11,5,7,2,2)â. Each character becomes an element of a string.
0-> (
1-> 1
2-> 1
3-> ,
+ 2
Nasif Rahman can u explain how?