[ Web Proxy ]
URL:
Viewing: https://mofanpy.com/tutorials/python-basic/basic/array-list [Back]  [Original]

| Python  [ ]

x AI


: Hao : : 2016-01-01

Tuple

tuple

a_tuple = (12, 3, 5, 15 , 6) another_tuple = 12, 3, 5, 15 , 6

List

list:

a_list = [12, 3, 67, 7, 82]

:

for content in a_list: print(content) """ 12 3 67 7 82 """ for content_tuple in a_tuple: print(content_tuple) """ 12 3 5 15 6 """

a_tuplea_list

for index in range(len(a_list)): print("index = ", index, ", number in list = ", a_list[index]) """ index = 0 , number in list = 12 index = 1 , number in list = 3 index = 2 , number in list = 67 index = 3 , number in list = 7 index = 4 , number in list = 82 """ for index in range(len(a_tuple)): print("index = ", index, ", number in tuple = ", a_tuple[index]) """ index = 0 , number in tuple = 12 index = 1 , number in tuple = 3 index = 2 , number in tuple = 5 index = 3 , number in tuple = 15 index = 4 , number in tuple = 6 """

:

""

wechat [wechat]
    []

    Python

    :



    Email: mofanpy@hotmail.com

    © 2022 mofanpy.com All Rights Reserved ICP20060366


    Web Proxy Viewer  |  New URL  |  Original Page