Changes

Jump to: navigation, search

OPS435 Python Lab 1

398 bytes added, 22:01, 17 July 2017
Printing Text
:# Issue the following function:<br><source>
print('hello world')
</source>This time we should now see that the python function "print()" has outputted to the screen the words 'hello world'. In python a word or a bunch of characters like 'hello world' is called a 'string'. So what we did above is, passed a '''string''' as a '''argument''' to the print '''function'''. These words are important for understanding and talking about different aspects of code.<br><br>
:# Note that there are similarities between the Python print() function and the Bash echo command, but Python is more picky than bash (which is a good thing). Try to run print without the brackets or without the quotes to see what happens.
<blockquote style="margin-left:35px;">{{Admon/tip|Reading errors|One of the things that makes a good programmer is debugging skills. The first and most important debugging technique is reading and understanding error messages. Try to understand what the errors are saying even if you think you already know what the problem is and already have some idea about how to fix it.}}</blockquote>
====Creating the introductory "Hello World" Script====

Navigation menu