Space Python Loading Python…

Special Characters in Print

 
0:00 / 0:00

Challenge

Practise what this example shows with these challenges.

Path in a config

Fix the codeEasy 2 stages

A Windows path prints wrong because \n and \t inside it turn into a new line and a tab. Fix it with a raw string, then handle a path that ends with a backslash.

Start the challenge

JSON-looking payload

Fix the codeMedium 2 stages

Print a JSON-style status message full of double quotes and an apostrophe exactly, then build it with an f-string that needs literal curly braces.

Start the challenge

Alert banner

Write the codeMedium 3 stages

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.

Start the challenge

Discussion

Stuck on this example or want to go further? Ask here, or see what others asked.

Log in to ask and reply.

script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].