-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitem.py
More file actions
35 lines (28 loc) · 889 Bytes
/
item.py
File metadata and controls
35 lines (28 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 11:28:25 2017
@author: vinntec
"""
class Item():
"""A class to create an item"""
def __init__(self, name):
"""Initialise an item with a name"""
self.name = name
self.description = None
# Describe this item
def describe(self):
"""Describe this item"""
print("The item " + self.name + " is here!")
print(self.description)
def get_name(self):
"""Return the name of this item"""
return self.name
def set_name(self, item_name):
"""Set the name of this item"""
self.name = item_name
def get_description(self):
"""Return the description of this item"""
return self.description
def set_description(self, item_description):
"""Set a description of this item"""
self.description = item_description