-
Notifications
You must be signed in to change notification settings - Fork 0
3.4.4 Arrays
Julio edited this page Jan 28, 2020
·
1 revision
Arrays are numeric in python
from array import *
### types
# 'i' int
# 'l' long
# 'f' float
# 'd' double-float
primes = array('i', [1, 2, 3, 5, 7, 11])
print(primes)
for n in primes:
print(n)
primes.append(13)
primes.reverse()
primes = sorted(primes)
primes.pop()
primes.remove(0) # 1 is not a prime!
# By index, 0th
primes.count(11)