Changes

Jump to: navigation, search

OPS445 Online Lab4

77 bytes added, 15:46, 20 January 2023
wget addr switched to github
cd ~/ops445/lab4/
pwd #confirm that you are in the right directory
ls CheckLab4.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab4-template/labsblob/LabCheckScriptsmaster/CheckLab4.py?raw=true' -O CheckLab4.py
python3 ./CheckLab4.py -f -v lab4a
</source></li>
cd ~/ops445/lab4/
pwd #confirm that you are in the right directory
ls CheckLab4.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab4-template/labsblob/LabCheckScriptsmaster/CheckLab4.py?raw=true' -O CheckLab4.py
python3 ./CheckLab4.py -f -v lab4b
</source>
cd ~/ops445/lab4/
pwd #confirm that you are in the right directory
ls CheckLab4.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab4-template/labsblob/LabCheckScriptsmaster/CheckLab4.py?raw=true' -O CheckLab4.py
python3 ./CheckLab4.py -f -v lab4c
</source>
cd ~/ops445/lab4/
pwd #confirm that you are in the right directory
ls CheckLab4.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab4-template/labsblob/LabCheckScriptsmaster/CheckLab4.py?raw=true' -O CheckLab4.py
python3 ./CheckLab4.py -f -v lab4d
</source>
if __name__ == '__main__':
s1 = 'Seneca'
print(s1,'contains letter s? ->',find(s1,'s')) print(s1,'contains letter S? ->',find(s1,'S'))
</source> The find() function defined above, is not needed, as it can be replaced by the python keyword '''in''', which can be used as a boolean operator. This boolean operator takes two strings, and return '''True''' if the first appears as a substring in the second.<br/>
cd ~/ops445/lab4/
pwd #confirm that you are in the right directory
ls CheckLab4.py || wget 'https://ictgithub.senecacollege.cacom/~eric.brauersenecaops445/ops445lab4-template/labsblob/LabCheckScriptsmaster/CheckLab4.py?raw=true' -O CheckLab4.py
python3 ./CheckLab4.py -f -v lab4e
</source></li>

Navigation menu