Hossain Shahriar shahriar@cs.queensu.ca CISC 101: Fall 2011 Hossain Shahriar shahriar@cs.queensu.ca
Installing python Goto http://www.python.org/download/ Choose Python 2.7.2 Windows Installer
Installing python
Python shell (IDLE)
Python shell: Let us play with it! What are these lines doing? Adding two numbers, subtracting two numbers, … Numeric operators applicable for constant numbers More operators: multiplication (*), division (/), mod (%) Try by yourselves and see if the results are expected (3*4) Question: How do I know it all by myself? http://docs.python.org/
Python shell: where to look for information? Question: The document is too formal to follow. Tips: Look at a tutorial at http://docs.python.org/tutorial/index.html
Python shell: Input and Output We are printing in the GUI console (Output) Let us make this example more interesting by taking an input! Wait! Input needs to be stored somewhere so that we can use it later
Python shell: Input and output We are storing hello in a variable named s print s displays the value stored in s The location is exclusively handled by python interpreter Allows us to focus on the necessary computation and logic We still have not seen any input taken from us?