#Project:W2: Lab Python and JSON Linux System #Purpose Details: The purpose of this program is to demonstrate # understanding of JSON and Python object creation by writing # and reading a Python object to and from a JSON file #Course: IST411, Section 001 #Author: Justin Grant #Date Developed: September 2, 2017 #Last Date Changed: September 2, 2017 #Rev: 0 import json #Car Classification class Car: #Car constructor method def __init__(self,carYear,carMake,carModel,carType,extraFeatures,color): self.carYear = carYear self.carMake = carMake self.carModel = carModel self.carType = carType self.extraFeatures = extraFeatures self.color = color #Generate Car Object car1 = Car("2009", "Nissan","Versa","4-Door Sedan","3", "blue") #print(repr(car1))
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question