Challenge
Path in a config
…ew elemetry.txt In Python text, a backslash starts an escape sequence: \n is a new line and \t a tab. That's exactly what happened to \new and \telemetry . Get the paths to print the way Windows…
6 results
Challenge
…ew elemetry.txt In Python text, a backslash starts an escape sequence: \n is a new line and \t a tab. That's exactly what happened to \new and \telemetry . Get the paths to print the way Windows…
Challenge
…quotes, but then the apostrophe in Don't ends the text. Escape the quote that clashes by putting a backslash before it: \' or \" . Braces in an f-string The message should be built from values, so the…
Quiz
…quiz on Python's print() function: 15 questions on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.
Challenge
Print an alert between two 30-character borders from a single f-string with \n, then add more lines and centre the title in the border.
Example
Special characters like \n and \t allow formatting text with new lines and tabs.
Article Python Fundamentals
…types print('Captain\'s log: Day 1') # Using backslash to escape single quote # Including special characters print("Temperature reading:\n20°C") # \n creates a new line print("Path to data…