python lists, tuples, and dictionaries

list Use the keyword [] to define the list. Here is a fruits = ["Apple", "Banana", "Pear"] The elements in the access list are accessed using subscripts. Like java, subscripts are calculated from 0, but python supports negative indexes, which start from the last bit print(fruits[0]) print(fruits[-1]) print(fruits[-2]) Apple Pear Banan ...

Added by BandonRandon on Tue, 26 Oct 2021 08:18:42 +0300