Changes

Jump to: navigation, search

OPS435 Online Lab1

187 bytes added, 22:58, 12 May 2020
Part I - Interactive (leaning) mode: using the Python Interactive Shell
</source>
:* Please note that the prompt changed from '''>>>''' to '''help>'''. Try the suggestion and feel free to explore the interactive help utility. Simple press the '''Enter''' key to get out of the interactive help utility.
:* At the '''>>>''' prompt, type '''dir()''' to call the built-in function named '''dir''' without passing any function argument to display it. The '''dir()''' function will return a list of data object names known to the Python interpreter at the that moment. You should get a list of items similar to the following: <source>
>>> dir()
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'x']
'type', 'vars', 'zip']
</source>
:* The above output shows a list of the so-called '''built-in run-time error codes''' items and '''bulit-in functions'''items. We are going to learn how to use them effective effectively in order to save our coding effort when writing Python programs/scripts.:* Let start starts with the following built-in functions:
:** print()
:** help()
:** type()
:* We can learn more about the above built-in functions within the Python interactive shell. Study the output of the following command at the '''>>>''' prompt and keep a record of them for future reference:<source>
>>> help(help)
1,760
edits

Navigation menu