Language
Collections
Use lists, tuples, and dictionaries to group values and build larger programs.
Lists
lists.tk
numbers = [10, 20, 30]
numbers[1] = 25
print(numbers[1])Tuples
tuples.tk
point = (10, 20)
print(point[0])Dictionaries
dicts.tk
person = {"name": "Ayaan", "age": 14}
print(person["name"])Indexing
Index collections with square brackets. The compiler supports indexed assignment for mutable collections such as lists.
indexing.tk
items = [1, 2, 3]
items[0] = 99
print(items[0])Length
length.tk
items = [10, 20, 30]
print(len(items))Comprehensions
comprehensions.tk
even = [x for x in range(20) if x % 2 == 0]