“menghitung” Kode Jawaban

untuk menghitung Python

for key, value in enumerate(["p", "y", "t", "h", "o", "n"]):
    print key, value

"""
0 p
1 y
2 t
3 h
4 o
5 n
"""
Weary Wombat

Python menghitung untuk loop

presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"]
for num, name in enumerate(presidents, start=1):
    print("President {}: {}".format(num, name))
Yawning Yacare

menghitung

array = ["one","two","three","four"]
arrayOfNumbers = []
mainArray = []

for i, x in enumerate(array):
	arrayOfNumbers.append(i)
    mainArray.append(x)
    
'''
>>print(arrayOfNumbers)
>>[0, 1, 2, 3]


>>print(mainArray)
>>["one","two","three","four"]

'''
Burak Bulama

menghitung

# enumerate
for index, item in enumerate(['sanjose', 'cupertino', 'sunnyvale', 'fremont']):
  print(index, ':', item)
  
# 0 : sanjose
# 1 : cupertino
# 2 : sunnyvale
# 3 : fremont 
Impossible Impala

Jawaban yang mirip dengan “menghitung”

Pertanyaan yang mirip dengan “menghitung”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya