Created
July 18, 2018 15:21
-
-
Save topherPedersen/478c94abe889931292ab2c1d4df9ae60 to your computer and use it in GitHub Desktop.
Simple Object Creation in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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