What's new

Closed pwede po ba gamitin ang insert sa array?

Status
Not open for further replies.
Python:
import numpy as np

a = np.array([])
num = input('input a size of array:')
print (type(a))
num = int(num)

b = 0
while b < num:
    x = input('input numbers')
    x = int(x)
    a[b] = np.insert(x)
    print (a)
    b+=1
print (a)
 
kulang parameters mo ng insert. insert(arr,obj,value)

Python:
import numpy as np

a = np.array([])
num = input('input a size of array:')
print (type(a))
num = int(num)

b = 0
while b < num:
    x = int(input('input numbers'))
    a = np.insert(a,b,x)
    print (a)
    b+=1
print (a)
 
Walang array sa python, duh. Unless gumamit ka ng NumPy. Though you can use list to mutate.
totoo walang built-in support for array ang python, but may alternative ways para makagawa ng array sa python
maka duh ka dyan yabang a, tsaka may array sa python bukod sa numpy, from array import *
you can use python lists for alternative. tingin ko pwede gamitin ang insert, pero ang natatandaan ko append for adding array elements sa python.
 
totoo walang built-in support for array ang python, but may alternative ways para makagawa ng array sa python

you can use python lists for alternative. tingin ko pwede gamitin ang insert, pero ang natatandaan ko append for adding array elements sa python.
tapos na po ako dito salamat po
 
totoo walang built-in support for array ang python, but may alternative ways para makagawa ng array sa python

you can use python lists for alternative. tingin ko pwede gamitin ang insert, pero ang natatandaan ko append for adding array elements sa python.
di namn built in sinasabi nya
 
tae di pala ako maalam mag delete ng thread.. pwede ba i delete tong thread na to?
 
duh, bakit ka pa gagamit ng ibang modules kung may list, dictionary or tuples na built-in naman? Kung gusto mo maging programmer kiddie for life, depend your projects on those modules. :)
 
Status
Not open for further replies.
Back
Top