Arrays
Example in Python
# Creating an array in Python
numbers = [1, 2, 3, 4, 5] # This is a list, commonly used as an array in Python
print(numbers[2]) # Accessing the third element (index starts at 0), which will print 3Example in C#
// Creating an array in C#
int[] numbers = new int[5] {1, 2, 3, 4, 5}; // Declaration and initialization of an array
Console.WriteLine(numbers[2]); // Accessing the third element, which will print 3Last updated
Was this helpful?