+ 9

How the output is 1 ?

a = (11,5,7,2,2) a = str(a) print(a[2]) Please Explain, How the output is 1?

26th Jun 2020, 6:01 PM
Olivia Munn đŸ™‹đŸ€·â€â™€
Olivia Munn đŸ™‹đŸ€·â€â™€ - avatar
3 Answers
+ 17
Well, a is "(11, 5, 7, 2, 2)". A character with index 2 is "1". This is how :)
26th Jun 2020, 6:05 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 12
so, a[0] is '(' , right ?
26th Jun 2020, 6:10 PM
Olivia Munn đŸ™‹đŸ€·â€â™€
Olivia Munn đŸ™‹đŸ€·â€â™€ - avatar
+ 9
Exactly
26th Jun 2020, 6:11 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar