Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
sai hw user enter table
nth root
abc
Iterator-1
Цифроразряды в разных системах счисления
mean
lesson7 part2
rectangle perimiter
Doki Doki Study Club p.one
Example for striping string
stackse - search stackoverflow differently
Please log in to post a comment.