예제 #1
0
def baja(array,code):
	index=find_code(array,code)
	if index != -1:
		array.remove(lib[index])
	else:
		print 'No se encontro'
	return
예제 #2
0
파일: array12.py 프로젝트: YSreylin/HTML
'''write a python program to remove the first occurrence of a specified element from an array'''
import array
array = array.array('i', [1, 2, 3, 4, 6, 7, 8, 9, 1])
print('Original array:', array)
a = int(input('Choose number:'))
array.remove(a)
print(array)
예제 #3
0
heroe8 = heroes("sagat")
heroe9 = heroes("zangieff")

fight1 = fight = True

arr = [
    "riu", "zangieff", "mrbison", "ken", "guille", "blanca", "sagat", "honda",
    "vega"
]

a = input("Player 1, Select hero: {} ".format(arr))
a = a.lower()

while len(arr) >= 9:
    if a == "riu":
        arr.remove("riu")

    elif a == "zangieff":
        arr.remove("zangieff")

    elif a == "mrbison":
        arr.remove("mrbison")

    elif a == "ken":
        arr.remove("ken")

    elif a == "guille":
        arr.remove("guille")

    elif a == "blanca":
        arr.remove("blanca")
예제 #4
0
import array as arr

n = int(input())
arr = map(int, input().split())

zes = max(arr)
i = 0

while (i < n):
    if zes == max(arr):
        arr.remove(max(arr))
    i += 1
print(max(arr))
print ("\r")

#using pop() to remove element at 2nd position
print ("The popped element is : ", end ="")
print (arr.pop(2))

#printing array after popping
print ("The array after popping is : ", end ="")
for i in range (0, 4):
    print (arr[i], end =" ")
    
print("\r")

#using remove() to remove 1st occurence of 1
arr.remove(1)

#printing array after removing
print ("The array after removing is : ", end ="")
for i in range (0, 3):
    print (arr[i], end =" ")
    


# In[7]:

#Python program to demonstrate
#slicing of elements in a Array

#importing array module
import array as arr
예제 #6
0
 def DeleteStmt(self, lineNo, arr):
     return arr.remove(arr[lineNo])