Skip to main content

Learn Python Tamil Py1

 


Py 1:                                                                        

      

உள்ளிடப்பட்டஎண் ஒற்றைப்படை அல்லது இரட்டைப்படைஎண்ணாஎன்பதைக் கண்டறியும் நிரல்

 

Program that detects whether the entered number is odd or even:

நிரல்:

a = int (input("Enter any number :"))

x="even" if a%2==0 else "odd"

        print (a, " is ",x)                                                          

 

Output 1:

                                                Enter any number :3

                        3 is odd

 

 

Output 2:

                                                Enter any number :22

22 is even                                                                                                 

 

Explain

1:  #எண்களைஉள்ளீடுசெய்வதர்க்கு

2:  #எண் இரட்டை(அ)ஒற்றை படை எனக் கண்டறிவதற்க்கு

3: # எண் இரட்டை(அ)ஒற்றை படை என அச்சிடுவதற்க்கு

 

 

Comments

Post a Comment

Popular posts from this blog

print() Function

                                             print () செயற்கூறு          பைத்தானில் , print() செயற்கூறு நிரலை இயக்கும் பொ ழுது தரவுகளை   வெளியிட ப யன்படுகிறது . In Python, the print () function is used to publish data while running the program print()  1 ] print (“string to be displayed as output ” ) 2] print (variable ) 3] print (“String to be displayed as output ”, variable) 4]  print (“String1 ”, variable, “String 2”, variable, “String 3” …) P rint()   Function Example >>> print (“Welcome to Learn Python Tamil”) Welcome to Learn Python Tamil >>> x = 25 >>> y = 23 >>> z = x + y >>> print (z) 48 >>> print (“The sum = ”, z) The sum = 48 >>> print (“The sum of ”, x, “ and ”, y, “ is ”, z) The sum of 25 a...