adding all files done so far
This commit is contained in:
23
learning/class-and-object-orianted-python/lesson1.py
Normal file
23
learning/class-and-object-orianted-python/lesson1.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!~/.virtualenvs/learning/bin/python
|
||||
|
||||
|
||||
class Customer(object):
|
||||
"""example class defining a customer deposit and withdraw methods
|
||||
for a bank.
|
||||
|
||||
Attributes:
|
||||
name: A string represnting the customer's name
|
||||
balance: A float tracking the current balance of the customer."""
|
||||
|
||||
def __init__(self, name, balance, list):
|
||||
super(Customer, self).__init__()
|
||||
self.name = name
|
||||
self.balance = balance
|
||||
self.list = list
|
||||
print(self.name)
|
||||
print(self.balance)
|
||||
for i in range(len(self.list)):
|
||||
print(self.list[i])
|
||||
|
||||
|
||||
Customer('Homer', 200, ['100', '102', '103'])
|
||||
Reference in New Issue
Block a user