String formatting Flashcards
1
Q
How can you format a string
A
Using f-strings
2
Q
How do you use a f-string
A
Put a f before the quotation marks
print(f”This is a f-string”)
3
Q
Usage of a f-string
A
Easy way to manipulate and print variables. Use the variables by putting it in curly brackets ‘{}’
4
Q
Formatting of f-strings examples
A
https://www.w3schools.com/python/ref_string_format.asp