Abhay Jajodia
Answered 2 questions
About

So, in Python, you don't need to use curly braces {}
when printing a variable like this:
name = input("Enter your name: ")
print("Your name is", name)
That works because print()
can take multiple things, separated by commas. It just puts spaces between them automatically, so you don't have to do anything fancy.
Now, curly braces do show up when you're using something like an f-string. That looks like this:
print(f"Your name is {name}")
In that case, the {name}
is inside the string, and Python replaces it with the actual value of the name
variable — but only because the string starts with an f
.
So yeah, curly braces are just for special formatting stuff like f-strings. If you're just printing normally with commas, you don’t need them at all.
So when you see something like , that little
/
just means the tag is self-closing — it doesn’t need an end tag like .
But guess what? Starting with HTML5, you don’t even need the /
anymore. You can just write:
And it works the same! Super simple. 👍