Lists using Input | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Lists using Input

So if I’m using input, I’m not understanding what I should use for “print” to get the right letter for the seats list. My first mistake was print(row[]column[]) seats = [ ['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i'], ['j', 'k', 'l'] ] row = int(input()) column = int(input()) print(

4th Feb 2021, 10:19 PM
Davon
Davon - avatar
1 Antwort
+ 1
For example seats[0][1] will return 'b' and seats[3][1] will return 'k', consider first index as row and second as column.
4th Feb 2021, 10:38 PM
Abhay
Abhay - avatar