Only 61/1000 spots left
BLACK FRIDAY: Receive 66% off Programiz PRO
+🎁 Receive your free 1:1 personal career coach & fast-track to your first paycheck
Meet my coach
Background Image
Meet my coach
B
last year
Bhumikacountry asked

Why is greeting not the output?

Sudip Bhandari
Expert
last year

Here, greeting is a variable. When you print a variable, you get the value stored inside it as the output.
That’s why when you print greeting, you see Merry Christmas—because that's the value stored in the variable.

If you want to print the word greeting itself (not the value), you need to enclose it in quotes, like this:

print("greeting")

In this case, "greeting" is treated as a string, not a variable. So the output will simply be:

greeting

Quick reminder:

  • Without quotes → Python treats it as a variable and shows its value.

  • With quotes → Python treats it as plain text (a string).

Hope this clears things up! Let me know if you have any other questions.

Python
This question was asked as part of the Learn Python Basics course.