FreeKB - Python (Scripting) Arrays []
Python (Scripting) - Arrays []

This is an empty array that contains no values.

fruits = []


This is an array that contains values.

fruits = ["apple", "banana", "orange", "grapes"]


You can print the array. This will display the entire array.

print fruits


You can print a certain value in the array. This will print "apple".

print fruits[0]


You can loop through the array.

for x in fruits:


This will print each fruit.



Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 52997 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |