Flashcards
Computing Array Flash Cards
Cards in this deck (6)
- 1What is an element?The items in an array
- 2What is an array?A list of elements enclosed by square brackets
- 3What is meant by a position or an indexThe elements in an array each have a position, starting at 0. An index is used to search for a specific elements position in an array.
- 4Give an example of an array in Python.shoppingList = ["milk", "eggs", "bread"]
- 5How do you add or remove elements to an array in Python?shoppingList.append("rice")
shoppingList.remove("eggs") - 6How do you make an array code output a random response?1. import random
2. dieNumbers = [1,2,3,4,5,6]
3. dieRoll = random.choice(dieNumbers)
4. print (dieRoll)
Information
- Description
- Flashcards on Computing Array Flash Cards, created by Cole Sutton on 09/12/2020.
- Created by
- Cole Sutton
- Views
- 0
- Rating