Showing posts with the label python programming

Featured Post

How to Compare Text in Python

Python like other programming languages supports comparison operators. These primarily use to test the condition in the program. Here's a list of operators that you can use in python programs. Comparison operators List of operators < <= > >= == != Is is not How to use comparison operators Here, I have assigned 23 to a and 11 to b. Then, I did apply all the comparison operators. The output is self-explanatory, and If you are in doubt while programming, remember to visit this page. Examples a = 23 b = 11 print("Is a greater than b?", a > b)           #greater than print("Is a less than b?", a < b)              #less than print("Is a greater or equal to b?", a >= b)   #greater or equal print("Is a less or equal to b?", a <= b)      #less or equal print("Is a equal to b (option 1)?", a == b)         #test for equality print("Is a equal to b (option 2)?", a is b)         #test for equality print("I

How to Write Python 'Hello World' Program Quickly and Run it

The first Python program looks like the below.  I have explained the steps you need to write your first program in Python. My first program: You can write your program as module. if authorsFirstName == 'Irv':       teachingPython = True       print 'Pay attention to his wisdom' How to Run Your Python Program python Sample python program if authorsFirstName == 'Irv':      teachingPython = True    print 'Pay attention to his wisdom' The above if condition checks for first name.  In python '==', means equal to. It makes true to teachingPython .  You can start your python program quickly. Really useful for learning and to use it in projects.