Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
bacs_class
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#python 2.7.12 # THE CLASS STARTS BEING DEFINED HERE class bacs_class: teacher = "" name = "" room = "" # the schedule block will be either A-Block, B-Block, C-Block # D-Block, E-Block, 1st-lunch, 2nd-lunch, Tue-CIP, and Thu-CIP schedule_block = "" students = [] homework = [] classwork = [] grades = [] def __init__(self, name, teacher, room, schedule_block): self.name = name self.teacher = teacher self.room = room self.schedule_block = schedule_block def print_class_info(): print() def set_teacher(teacher): self.teacher = teacher def get_teacher(): return self.teacher def get_class_size(): return len(students) def add_student(name): self.students.append(name) def remove_student(name): self.students.remove(name) def add_classwork(name, description): self.classwork[ name ] = description def remove_classwork(name): del(self.classwork[name]) ##### def set_room(): def get_room(): def set_schedule_block(): def get_schedule_block(): def add_homework(): def remove_homework(): ##### ### THIS IS THE END OF THE CLASS varsity_coding = bacs_class("Varsity Coding", "Paul P.", "Room 106", "Thu-CIP") varsity_coding.add_student("Haley") varsity_coding.add_student("Dylan") varsity_coding.add_student("Jason") varsity_coding.add_student("Katie") varsity_coding.add_classwork("Code Sample #1", "Analyze the code sample and tell us what it does") varsity_coding.add_classwork("Code Sample #2", "Begin Working With Lists")
[
+
]
Show input
edit mode
|
history
|
discussion