Ramcharan
asked

Expert
Abhay Jajodia answered
Hi Ramcharan,
Yes, you can use quotes around numbers in print(), but it changes what you're printing.
For example:
print(65.6) # prints a number
print("65.6") # prints a string that looks like a number
Both will display 65.6, but the first one is a number, and the second is a string. Python treats them differently.
If you're just printing a value, both work. But if you want to use that value later for math, keep it as a number — don’t put it in quotes.
If you have more questions, I am here to help.
Python
This question was asked as part of the Getting started with Python course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer