Pre-recorded question

Question #146
How to create a list with given values in Python?
Answer

Here is how to create a list in Python with provided values:

# Create list of integers
my_list = [1, 2, 3, 4, 5]

Note that data types can be mixed in Pyhton lists:

# List with mixed data types
my_list = ["Hello", 123; 3.1415]

2 events in history
Answer by Alphonsio 08/27/2020 at 01:38:52 PM

Here is how to create a list in Python with provided values:

# Create list of integers
my_list = [1, 2, 3, 4, 5]

Note that data types can be mixed in Pyhton lists:

# List with mixed data types
my_list = ["Hello", 123; 3.1415]

Question by Alphonsio 08/27/2020 at 01:35:44 PM
How to create a list with given values in Python?
# ID Query URL Count

Icons proudly provided by Friconix.