+ 1

Where is the bug?

Why it outputs an error? sentence = lambda name: "Hello,", name print(sentence("Jakob")) https://sololearn.com/compiler-playground/chE9gTsNZeHl/?ref=app

18th Aug 2025, 7:39 AM
Jakob
Jakob - avatar
5 odpowiedzi
+ 1
You need to do string interpolation. sentence = lambda name: f"Hello, {name}"
18th Aug 2025, 8:03 AM
Mila
Mila - avatar
+ 1
You can also put 2 strings together: sentence = lambda name: "Hello, " + name
18th Aug 2025, 8:06 AM
Mila
Mila - avatar
+ 1
Why do I have to do that? In the course they don't do it.
18th Aug 2025, 8:39 AM
Jakob
Jakob - avatar
0
You will learn about putting strings together and about string interpolation in the Python Intermediate course.
18th Aug 2025, 8:47 AM
Mila
Mila - avatar