DEV Community

Discussion on: Automating my workflow with Python #1: File Organizer

Collapse
 
titanhero profile image
Lex • Edited

Cool, I have very long time without code in python in an extended way, so things like this help me a lot to remember, but I have a thing that I didn't understood in here, in your condition to handle your exception with the length of arguments in a print function you use the character f before the text string, here:

print(f"[Usage] python {Path("

what does the "f"?

Collapse
 
gagangulyani profile image
Gagan Deep Singh

f-strings (formatted strings) are new in Python 3 😎 They make string formatting a lot easier. I could have used format function instead of using f as a prefix but just by adding that, I get to write cleaner and more readable code.

Collapse
 
titanhero profile image
Lex

Yeah already I I read about f strings, them are amazing...👍✌️