Print command in Python

#Printing with .format():Use the .format() method for string formatting.

print(“Name: {}, Age: {}, City: {}”.format(name, age, city))

Name: Ravi, Age: 25, City: New York என அச்சிடுகிறது. இந்த நிரல் எங்கிருந்து value களை பெறுகிறது.

#variable name , age , city are user defined

name = input(“Enter Name :”)
age = input (“Enter Age :”)
city = input(“Enter City :”)

print(“Name: {}, Age: {}, City
{}”.format(name, age, city))

#Done

1 Like

அந்த codeல் நான் எங்கும் variable declare செய்யவில்லை. நிரல் colab ல் ஏற்கனவே உள்ள மதிப்புகளை எடுத்துக் கொள்கிறது. இதைல் ஏதாவது வரைமுறை உள்ளதா?

If the variables been set with a value in the colab and its executed, then its in the memory.
So the values will be reflecting all through the colab.

If you want to delete the variables,

del name
del age
del city

Similar to this question was asked in Q&A session.
Link to the particular question: https://youtu.be/meL9tOq5aTg?t=2819&si=qKWCxl2iKge2eith