List Method 2

Run Settings
LanguagePython
Language Version
Run Command
basket = ['a','b','c','d','e','d'] print(basket.count('d')) #COunt of d in the arrary basket print(basket.index('d',0,4)) #Index of d starts with 0 and ends at 4 in the basked array print('b' in 'duplicate not done') print('d' in 'duplicate not done') # basket.sort() - sort as method print(basket) print(sorted(basket)) #sort as function - function does't modify the array - it creates a new copy of array print(basket) basket.reverse() print(basket) print(basket[::-1]) # slicing for reverse print(list(range(1,100))) print(list(range(101)))
Editor Settings
Theme
Key bindings
Full width
Lines