3.4.4. Numeric Arrays - JulTob/Python GitHub Wiki

from array import *

# --  Types  -- #
'i'     Integer
'l'     Long
'f'     Float
'd'     Double


nums = array('i',[45, 324, 654, 45, 264])
print(nums)

for n in nums:
  print(n)

newValue = int(input("Enter number: ")
nums.append(newValue)

#-- Order --#
nums.reverse()
nums = sorted(nums)

nums.pop()   # Removes last


newArray = array(‘i’,[])
more = int(input(“How many items: ”))
for y in range(0,more):
  newValue=int(input(“Enter num: ”))
  newArray.append(newValue)
nums.extend(newArray)

getRid = int(input(“Enter item index: ”))
nums.remove(getRid)

print(nums.count(45))  # How many times 45 is in the array