Sabtu, 01 Oktober 2022

List Function in Python

 

Definition and Usage

The list() function creates a list object.

A list object is a collection which is ordered and changeable.


Sample scripts :


x = list(('apple', 'banana', 'cherry'))

print(x)


Output : 

['apple', banana', 'cherry']


Source : https://www.w3schools.com/python/ref_func_list.asp#:~:text=The%20list()%20function%20creates,which%20is%20ordered%20and%20changeable.

Tidak ada komentar:

Posting Komentar

List Function in Python

  Definition and Usage The  list()  function creates a list object. A list object is a collection which is ordered and changeable. Sample sc...