Python Programming : Intermediate (Leaving Cert Computer Science): Flashcards
📚Flashcards
Practise the cards
15 cards from this deck
ShowHide
Practise the cards
15 cards from this deck
What does str.upper() do?
What does str.upper() do?
Converts all characters to uppercase
What does str.strip() do?
What does str.strip() do?
Removes leading and trailing whitespace
Starting index of strings in Python
Starting index of strings in Python
0
String slicing [start:end] behavior
String slicing [start:end] behavior
From start index up to but not including end
str.find(sub) return value if not found
str.find(sub) return value if not found
-1
Escape character for newline
Escape character for newline
\n
Boolean 'and' operator result
Boolean 'and' operator result
True if both operands are true
Purpose of elif statement
Purpose of elif statement
Checks multiple conditions after if
Are Python lists mutable?
Are Python lists mutable?
Yes, elements can be changed after creation
What does list.append() do?
What does list.append() do?
Adds an element to the end of the list
list.pop() with no index specified
list.pop() with no index specified
Removes and returns the last item
while loop execution condition
while loop execution condition
Executes while given condition is True
count += 1 equivalent to
count += 1 equivalent to
count = count + 1
for loop purpose in Python
for loop purpose in Python
Iterates over iterable objects
range() function purpose
range() function purpose
Generates a sequence of numbers
