OneBite.Dev - Coding blog in a bite size

create an array of string in python

Code snippet on how to create an array of string in python

arr = ["apple", "banana", "mango"]

This code creates an array in Python called “arr”. An array is a type of data structure that can store multiple values of the same type (in this case strings). The values stored in this example are “apple”, “banana”, and “mango”. Array elements are stored inside square brackets and are separated by commas. This code creates the array and assigns three strings to it.

python