Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lesson 7
# Object Oriented Programming ''' 1. Create a Class called Student 2. Instantiate an object of the class (create an example of the class) 3. Student(): attribute: first name attribute: last name attribute: email address Class: Student() Object: std_1, std_2, ... Constructor: def __init__(self Attributes: first, last, email, UIN ''' # University, Chemistry Course [40 students] class Student: def __init__(self, first, last, UIN): # constructor self.first = first self.last = last self.email = first + '.' + last + '@email.com' self.UIN = UIN # 'std_1' is an object for my class 'Student' std_1 = Student('Ali','Ahmed',100) std_2 = Student('Noor','Fatima',201) std_3 = Student('Shaikha','Ahmed',152) std_4 = Student('James','White',183) std_5 = Student('John','Hutch',104) std_6 = Student('Jim','Rogers',405) std_7 = Student('Little','Stuart',206) print (std_1.UIN) print (std_2.UIN) print (std_3.UIN) print (std_4.UIN)
run
|
edit
|
history
|
help
0
Calc1
gj
shuru17
Rektangel
gj3
binary search
Ball
Nearest Prime Number
あだだだだだだだだだだだだだだだだだだだだだだだだ
floating point limitations