Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 1

109 bytes removed, 19:54, 16 January 2018
String Variables
:'''Perform the following steps:'''
:#First, launch the ipython3 shellCreate a python script (called lab1b.py) and first - start with a few simple things to try:<source>ipython3</source>:#Let's make a new variable containing a value by issuing the following command:<source lang="python">
name = 'Thomas'
</source>
:#Type the variable name to inspect the value it contains<source lang="python">
name
</source>
:#Print the value to the screen:<source lang="python">
print('I have a friend named ' + name)
</source>
:#To gain practice, create a complete your python script (called lab1b.py) with the following content and details:
::::* The script should have a '''Shebang line''' like you did for your lab1a.py python script
::::* The script should use a single variable called "name"