strings in python Flashcards
Are strings immutable?
Strings are immutable, because you can’t modify them.
What types of quotation marks can be used with strings?
Single, double, and triple quotation marks.
What is the string method call to use to break strings into separate lines?
The .split(‘ ‘) method, which includes the newline character, breaks strings into separate lines.
What two string methods can you use to check to see whether a word exists in a string?
The .find() and .count() methods.
What is a problem you might run into when you use % for formatting?
The code can be harder to read when many replacements are needed.
How can you round down a number when you use f-strings?
Use the round() function inside the string, enclosed in braces ({}).