Simple output statement

The print() function

In Python, the print() function is used to display result on the screen. The syntax for

print() is as follows:

1. உங்களுக்கு தேவையான sentence நேரடியாக output screen வரவேண்டும் என்றால் நீங்கள் அதனை double quotes ("") ல் தர வேண்டும் 

            print (“string to be displayed as output ” )

2. நீங்கள் உங்களுக்கு தேவையான value வை ஒரு variable store செய்து வைத்திருந்தால் அதற்கு நீங்கள் variable name ஐ நேரடியாக தர வேண்டும். double quotes ("") போடக்கூடாது 

            print (variable )

3. உங்களுக்கு sentence மற்றும் variable name இரண்டும் output screen ல் வரவேண்டும் என்றால் sentenceஐ double quotes ("") ல் தர வேண்டும் variable nameஐ  double quotes ("") இல்லாமல் போடக்கூடாது இரண்டிற்கும் நடுவில் comma (,) போடவேண்டும் 

            print (“String to be displayed as output ”, variable)

            print (“String1 ”, variable, “String 2”, variable, “String 3” ……)


மேலே கொடுக்கப்பட்ட example எளிமையாக print statement ஐ விளக்குகிறது 

முதலில் sentence நேரடியாக output screen வந்துள்ளது, இரண்டாவது variable name ஐ பயன்படுத்தி value பிரிண்ட் செய்யப்பட்டுள்ளது, மூன்றாவதாக sentence மற்றும் value  இரண்டும் ஓன்றாக வந்துள்ளது 

No comments:

Post a Comment