Python:Creating an Array

From Progzoo
Jump to: navigation, search

Create a List Literal

You can initialise the list to a specific list of values:


[Font] [Default] [Show] [Resize] [History] [Profile]

Repeating a List

If you want to create a list of a certain length all filled with the same value, for example, you can repeat a list by using the multiplication operator:


[Font] [Default] [Show] [Resize] [History] [Profile]

Create a two dimensional List Literal

You can initialise the list to a specific list of values:


[Font] [Default] [Show] [Resize] [History] [Profile]

Create a String List using split

The split method can be useful for creating string list:


[Font] [Default] [Show] [Resize] [History] [Profile]