Category "python tutorial"

on in python tutorial

Previous | Next Looping is about how you can repeat a block of statements until some condition is met. With a for loop, the mechanism for repeating a set of statements allows execution to continue until it exhausts all of your list’s data. List will be discussed later in this tutorial. for <element> in <sequence>:......

[ Click to Continue ]
on in python tutorial

Previous | Next Looping is about how you can repeat a block of statements until some condition is met. With a while loop, the mechanism for repeating a set of statements allows execution to continue for as long as a specified logical expression evaluates to true. while <expression>:   <while-processing code> Let’s try the following......

[ Click to Continue ]
on in python tutorial

Previous | Next The condition statement allow the Python program to decide whether or not to execute a block of statements based on the return boolean value from condition expression. if clauses if <expression>:   <block of statements> Let’s try with the following example: value = 100 if value > 50:   print 'Value is......

[ Click to Continue ]
on in python tutorial

Previous | Next You may have written a program that you need an input from user in order to continue the processing. Let’s take a look at the useful function to handle this. input() Let’s try to get user input with the following sample code: >>> input("Enter value: ") Enter value: 90 90 When you......

[ Click to Continue ]
on in python tutorial

Previous | Next A variable is basically a name that represents or refers to some value. Assigning a variable in Python is simple. For example, you might want the name w to represent 8. To make it so, simply execute the following: Arithmetic Operators: Assuming a = 10 and b = 2 Opertor Description Example......

[ Click to Continue ]
on in python tutorial

Previous | Next A variable is basically a name that represents or refers to some value. Assigning a variable in Python is simple. For example, you might want the name w to represent 8. To make it so, simply execute the following: >>> w = 8 To make x to represent a float: >>> x......

[ Click to Continue ]
on in python tutorial

Previous | Next You are going to write your first Python program now. Let’s try this by writing a simple “hello” Python script, save it and execute it. Saving .py file Type the following using an editor. Save the file as hello.py. Please note that all python script file will use .py as its file......

[ Click to Continue ]
on in python tutorial

Previous | Next Let’s add the Python directory into the PATH environment variable so that the operating system will search through when programs attempt to execute a command Adding directory to Windows PATH environment variable Run the Windows command prompt and type the following: C:\>PATH %path%;C:\python This will add C:\python into windows PATH environment variable.......

[ Click to Continue ]