Search found 1 match

by mikesmith
Sat Jan 23, 2021 9:35 pm
Forum: Programs, Libraries and Tools
Topic: How do I create and use integer array?
Replies: 5
Views: 10756

Re: How do I create and use integer array?

It can be as simple as: numbers = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Pedantically, that's not an array - it's a list - but it's indexable and mutable in exactly the sort of ways that you care about. >>> numbers[7] = 11 >>> numbers[5] = 12 >>> numbers[3] = numbers[5] * 2 >>> print(numbers) [0, 0, 0, 24, ...