Changes

Jump to: navigation, search

OPS435 Online Lab6

26 bytes removed, 23:39, 9 November 2020
PART 1 - Creating a Class
class Student:
# Define the name and student ID number (which is a string) when a student object is created, ex. student1 = Student('john', '025969102')
def __init__(self, name, number):
self.name = name
student1 = Student('John', '013454900')
</source>
Note: Student ID number should be a String, not an integer.
:# Have a look at the contents of the object student1:<source lang="python">
print(student1.name)
cd ~/ops435/lab6/
pwd #confirm that you are in the right directory
ls CheckLab6.py || wget https://ict.senecacollege.ca/~ericraymond.brauerchan/ops435/labs/LabCheckScripts/CheckLab6.py
python3 ./CheckLab6.py -f -v lab6a
</source>
1,760
edits

Navigation menu