#Robert Nool #Pet Class #Start class pet(object): def __init__(self, name, petType, age): self.__name = name self.__petType = petType self.__age = age def set_name(self, name): self.__name = name def set_petType(self, petType): self.__petType = petType def set_age(self, age): self.__age = age def get_name(self): return self.__name def get_petType(self): return self.__petType def get_age(self): return self.__age def main(): name = raw_input() petType = raw_input() age = int(input()) animal = pet(name, petType, age) print 'Pet Data:\n' print 'Name: {}'. format(animal.get_name()) print 'Type: {}'. format(animal.get_petType()) print 'Age: {}'. format(animal.get_age()) main() #End
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