Python Flashcards
What is <
Less than
What is <=
Less than or equal to
What is >
Greater than
What is >=
Greater than it equal to
What is ==
Equal to
What is !=
Not equal to
What is and
As well as
What is or
This or that
How would you write a line of code for a integer variable
Number = int(input(“”))
What do you need at the end of your ‘if’, ‘Elif’ and ‘else’ statement before your print command
A colon :
Which brackets do lists go into
[box brackets]
What number does a list assign to the first in the list
0
What does
list.append(item)
Do
Add an item to the end of the list
What does
list.insert(index, item)
Do
Insert an item at a given position
What does
list.pop(index)
Do
Removes the item at the given position in the list, and return it. If not index specified, remove and return the last item in the list
What does
list.remove(item)
Do
Remove the first item from the list with a particular value. Raises a ValueError if there is no such item
What does
list.index(item)
Do
Search for the first occurrence of an item in the list and return its (zero-based) index. Raises a ValueError is there is no such item
What does
list.count(item)
Do
Return the number of times an item appears in the list
What does
list.reverse()
Do
Reverse the items of the list
what does
list.sort()
Do
Sort the items if the list
What does
list.sort(reverse = True)
Do
Use the reverse = True argument to sort in descending order
When working with lists do the things in the brackets have speech marks?
Yes
What is a list
A list is a kind of data structure, an organized collection of data
What is the number given to the first value in a list
0