Skip to content

Instantly share code, notes, and snippets.

@topherPedersen
Created July 18, 2018 15:21
Show Gist options
  • Save topherPedersen/478c94abe889931292ab2c1d4df9ae60 to your computer and use it in GitHub Desktop.
Save topherPedersen/478c94abe889931292ab2c1d4df9ae60 to your computer and use it in GitHub Desktop.
Simple Object Creation in Python
# This sample code is for reference teaching students Python at theCoderSchool in Flower Mound, TX
class Student:
def __init__(self, name, gradeLevel, average):
self.name = name
self.gradeLevel = gradeLevel
self.average = average
chris = Student("Chris", 12, 88)
print("Meet " + chris.name + "!")
print("Chris is in the " + str(chris.gradeLevel) + "th Grade...")
print("At the moment, his grade for this class is " + str(chris.average) + "%.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment