Starlit Daily

📚 › Python: the friendliest first language

3. Strings and f-strings

इस लेख का अनुवाद अपने आप होगा। अभी अंग्रेज़ी में दिखाया जा रहा है।

Strings can be joined with +, repeated with *, and measured with len(). An f-string puts values inside text: write an f before the quote and put the variable in braces, as in f"Hi {name}".

f-strings are the easiest way to mix text and numbers.

उदाहरण देखें

name = "Rahim"
score = 42
print(f"{name} scored {score} points")

✍️ अब आपकी बारी

Let city = "Sylhet". Print: I live in Sylhet.

← कोर्स पर वापस