Flashcards
Computing - Flashcards about arrays
Cards in this deck (6)
- 1Create an array of stringsvariable = ["item1", "item2", "item3"...]
- 2Add an element to an arrayvariable.append("item4")
- 3Remove an element from an arrayvariable.remove("item1")
- 4Find the position of an element in an arrayposition = variable.index("item2")
- 5Choose a random element from the arrayrandItem = random.choice(variable)
- 6Search for an element in an arrayuserItem = input("Find an item")
if userItem in variable:
Information
- Description
- Flashcards on Computing - Flashcards about arrays, created by Kyle Dewfall on 19/11/2020.
- Created by
- Kyle Dewfall
- Views
- 16
- Rating