Day77 incorrect code in examples

Problem description

In the Day 77 examples, David repeatedly shows using page.replace() to replace substrings with variables. This doesn’t work - strings are immutable, so the code would have to be page = page.replace().

Expected behavior

Running the code should replace the {placeholders} with the contents of the variables.

Actual behavior

No replacement is made, since the string.replace() is never assgined to a new string.

Steps to reproduce

Copy examples using page.replace() (the first occurrence is on the “fStrings and replacing” page) to the main.py window. Add a print() statement to view the contents of page. Run code.

Browser

Chrome (Slimjet)

OS

Windows 10

Device if mobile

n/a

Plan

free tier

Please upload screenshots

1 Like

Thank you for reporting @SirGeremiah. I’ll have the team review.

1 Like

This should be fixed now! Mostly using the suggestion you made page = page.replace()which works great to give the desired placeholders.

1 Like

Awesome! Glad I could help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.