Sunday, April 21, 2024

📑 Curly Braces inside F-strings

📑 Task

1) Will the code print out the elements of the interval?
2) What minimal changes can be made to the code to see
the elements of this interval?

📑 Answer

1) The code will only display the command text
{*map(str, numbers)} {*numbers}
2) It needs to add spaces between the curly braces
or replace the inner curly braces with square braces

No comments:

Post a Comment