diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3b1cfda Binary files /dev/null and b/.DS_Store differ diff --git a/lesson04/data_types.py b/lesson04/data_types.py index 7bb8979..467283f 100644 --- a/lesson04/data_types.py +++ b/lesson04/data_types.py @@ -3,8 +3,8 @@ # literal assignment -first = "Dave" -last = "Gray" +# first = "Dave" +# last = "Gray" # print(type(first)) # print(type(first) == str) @@ -17,120 +17,120 @@ # print(isinstance(pizza, str)) # Concatenation -fullname = first + " " + last -print(fullname) +# fullname = first + " " + last +# print(fullname) -fullname += "!" -print(fullname) +# fullname += "!" +# print(fullname) -# Casting a number to a string -decade = str(1980) -print(type(decade)) -print(decade) +# # Casting a number to a string +# decade = str(1980) +# print(type(decade)) +# print(decade) -statement = "I like rock music from the " + decade + "s." -print(statement) +# statement = "I like rock music from the " + decade + "s." +# print(statement) -# Multiple lines -multiline = ''' -Hey, how are you? +# # Multiple lines +# multiline = ''' +# Hey, how are you? -I was just checking in. - All good? +# I was just checking in. +# All good? -''' -print(multiline) +# ''' +# print(multiline) -# Escaping special characters -sentence = 'I\'m back at work!\tHey!\n\nWhere\'s this at\\located?' -print(sentence) +# # Escaping special characters +# sentence = 'I\'m back at work!\tHey!\n\nWhere\'s this at\\located?' +# print(sentence) -# String Methods +# # String Methods -print(first) -print(first.lower()) -print(first.upper()) -print(first) +# print(first) +# print(first.lower()) +# print(first.upper()) +# print(first) -print(multiline.title()) -print(multiline.replace("good", "ok")) -print(multiline) +# print(multiline.title()) +# print(multiline.replace("good", "ok")) +# print(multiline) -print(len(multiline)) -multiline += " " -multiline = " " + multiline -print(len(multiline)) +# print(len(multiline)) +# multiline += " " +# multiline = " " + multiline +# print(len(multiline)) -print(len(multiline.strip())) -print(len(multiline.lstrip())) -print(len(multiline.rstrip())) +# print(len(multiline.strip())) +# print(len(multiline.lstrip())) +# print(len(multiline.rstrip())) -print("") +# print("") -# Build a menu -title = "menu".upper() -print(title.center(20, "=")) -print("Coffee".ljust(16, ".") + "$1".rjust(4)) -print("Muffin".ljust(16, ".") + "$2".rjust(4)) -print("Cheesecake".ljust(16, ".") + "$4".rjust(4)) +# # Build a menu +# title = "menu".upper() +# print(title.center(20, "=")) +# print("Coffee".ljust(16, ".") + "$1".rjust(4)) +# print("Muffin".ljust(16, ".") + "$2".rjust(4)) +# print("Cheesecake".ljust(16, ".") + "$4".rjust(4)) -print("") +# print("") -# string index values -print(first[1]) -print(first[-1]) -print(first[1:-1]) -print(first[1:]) +# # string index values +# print(first[1]) +# print(first[-1]) +# print(first[1:-1]) +# print(first[1:]) -# Some methods return boolean data -print(first.startswith("D")) -print(first.endswith("Z")) +# # Some methods return boolean data +# print(first.startswith("D")) +# print(first.endswith("Z")) -# Boolean data type -myvalue = True -x = bool(False) -print(type(x)) -print(isinstance(myvalue, bool)) +# # Boolean data type +# myvalue = True +# x = bool(False) +# print(type(x)) +# print(isinstance(myvalue, bool)) -# Numeric data types +# # Numeric data types -# integer type -price = 100 -best_price = int(80) -print(type(price)) -print(isinstance(best_price, int)) +# # integer type +# price = 100 +# best_price = int(80) +# print(type(price)) +# print(isinstance(best_price, int)) -# float type -gpa = 3.28 -y = float(1.14) -print(type(gpa)) +# # float type +# gpa = 3.28 +# y = float(1.14) +# print(type(gpa)) -# complex type -comp_value = 5+3j -print(type(comp_value)) -print(comp_value.real) -print(comp_value.imag) +# # complex type +# comp_value = 5+3j +# print(type(comp_value)) +# print(comp_value.real) +# print(comp_value.imag) -# Built-in functions for numbers +# # Built-in functions for numbers -print(abs(gpa)) -print(abs(gpa * -1)) +# print(abs(gpa)) +# print(abs(gpa * -1)) -print(round(gpa)) +# print(round(gpa)) -print(round(gpa, 1)) +# print(round(gpa, 1)) -print(math.pi) -print(math.sqrt(64)) -print(math.ceil(gpa)) -print(math.floor(gpa)) +# print(math.pi) +# print(math.sqrt(64)) +# print(math.ceil(gpa)) +# print(math.floor(gpa)) -# Casting a string to a number -zipcode = "10001" -zip_value = int(zipcode) -print(type(zip_value)) +# # Casting a string to a number +# zipcode = "10001" +# zip_value = int(zipcode) +# print(type(zip_value)) -# Error if you attempt to cast incorrect data -# zip_value = int("New York") +# # Error if you attempt to cast incorrect data +# # zip_value = int("New York") diff --git a/lesson05/rps.py b/lesson05/rps.py index 582ec47..5a8a5ad 100644 --- a/lesson05/rps.py +++ b/lesson05/rps.py @@ -10,8 +10,7 @@ class RPS(Enum): print("") -playerchoice = input( - "Enter...\n1 for Rock,\n2 for Paper, or \n3 for Scissors:\n\n") +playerchoice = input("Enter...\n1 for Rock,\n2 for Paper, or \n3 for Scissors:\n\n") player = int(playerchoice) @@ -23,8 +22,8 @@ class RPS(Enum): computer = int(computerchoice) print("") -print("You chose " + str(RPS(player)).replace('RPS.', '') + ".") -print("Python chose " + str(RPS(computer)).replace('RPS.', '') + ".") +print("You chose " + str(RPS(player)).replace("RPS.", "") + ".") +print("Python chose " + str(RPS(computer)).replace("RPS.", "") + ".") print("") if player == 1 and computer == 3: diff --git a/lesson06/lists.py b/lesson06/lists.py index dc9d72a..6ef6678 100644 --- a/lesson06/lists.py +++ b/lesson06/lists.py @@ -1,71 +1,79 @@ -users = ['Dave', 'John', 'Sara'] +users = ["John", "Sara", "Dave"] -data = ['Dave', 42, True] +data = ["Dave", 42, True] emptylist = [] -print("Dave" in emptylist) +# print("Dave" in emptylist) -print(users[0]) -print(users[-2]) +# print(users[0]) +# print(users[-2]) -print(users.index('Sara')) +# print(users.index('Sara')) -print(users[0:2]) -print(users[1:]) -print(users[-3:-1]) +# print(users[0:2]) +# print(users[1:]) +# print(users[-3:-1]) -print(len(data)) +# print(len(data)) -users.append('Elsa') -print(users) +# users.append('Elsa') +# print(users) -users += ['Jason'] -print(users) +# users += ['Jason'] +# print(users) -users.extend(['Robert', 'Jimmy']) -print(users) -# users.extend(data) +# users.extend(['Robert', 'Jimmy']) # print(users) -users.insert(0, 'Bob') -print(users) +# # users.extend(data) +# # print(users) -users[2:2] = ['Eddie', 'Alex'] -print(users) +# users.insert(0, 'Bob') #Added to beginning of the list +# print(users) -users[1:3] = ['Robert', 'JPJ'] -print(users) +# users[2:2] = ['Eddie', 'Alex'] #Added not replaced anyone +# print(users) -users.remove('Bob') -print(users) +# users[1:3] = ['Robert', 'JPJ'] #replaced two values +# print(users) -print(users.pop()) -print(users) +# users.remove('Bob') #first user +# print(users) -del users[0] -print(users) +# print(users.pop()) #last user. Returns user removed. +# print(users) + +# del users[0] #specify index +# print(users) + +# # del data +# print(data) #error -# del data -data.clear() -print(data) +# data.clear() #empties list but list exists +# print(data) +print(users) -users[1:2] = ['dave'] +users[1:2] = ["dave"] +print(users) users.sort() print(users) users.sort(key=str.lower) print(users) -nums = [4, 42, 78, 1, 5] +nums = [4, 40, 42, 78, 1, 5, 100] +nums.sort() +print(nums) + nums.reverse() print(nums) # nums.sort(reverse=True) # print(nums) -print(sorted(nums, reverse=True)) +print(sorted(nums, reverse=True)) # doesn't mutate print(nums) numscopy = nums.copy() @@ -85,7 +93,7 @@ # Tuples -mytuple = tuple(('Dave', 42, True)) +mytuple = tuple(("Dave", 42, True)) anothertuple = (1, 4, 2, 8, 2, 2) @@ -94,7 +102,8 @@ print(type(anothertuple)) newlist = list(mytuple) -newlist.append('Neil') +anotherTuple = list() +anotherTuple.append("Neil") newtuple = tuple(newlist) print(newtuple) @@ -103,4 +112,12 @@ print(two) print(hey) -print(anothertuple.count(2)) +print(anothertuple.count(2)) # returns number of occurences + + +# Lists and Tuples +# Lists use [] and are mutable +# Tuples use () and are immutable +# They both are ordered, have indexing / slicing methods, and duplicate elements +# Sets +# Sets are not ordered, not index based, don't have duplicate elements diff --git a/lesson07/dictionaries.py b/lesson07/dictionaries.py index d65009d..f81e0eb 100644 --- a/lesson07/dictionaries.py +++ b/lesson07/dictionaries.py @@ -27,12 +27,20 @@ # verify a key exists print("guitar" in band) print("triangle" in band) +print("") +print("") +print("") # Change values +print("CHECK") +print(band) +print(band["vocals"]) + band["vocals"] = "Coverdale" band.update({"bass": "JPJ"}) - print(band) +print("") +print("") # Remove items print(band.pop("bass")) diff --git a/lesson08/loops.py b/lesson08/loops.py index 6551708..fc842cb 100644 --- a/lesson08/loops.py +++ b/lesson08/loops.py @@ -14,16 +14,12 @@ # print("Value is now equal to " + str(value)) names = ["Dave", "Sara", "John"] -# for x in names: -# print(x) -# for x in "Mississippi": -# print(x) -# for x in names: -# if x == "Sara": -# break -# print(x) +for x in names: + if x == "Sara": + break + print(x) # for x in names: # if x == "Sara": diff --git a/lesson08/rps2.py b/lesson08/rps2.py index 9c7eb6f..d46a7bd 100644 --- a/lesson08/rps2.py +++ b/lesson08/rps2.py @@ -8,7 +8,7 @@ class RPS(Enum): PAPER = 2 SCISSORS = 3 - + playagain = True while playagain: diff --git a/lesson09/functions.py b/lesson09/functions.py index 83362a3..05702dd 100644 --- a/lesson09/functions.py +++ b/lesson09/functions.py @@ -6,7 +6,7 @@ def hello_world(): def sum(num1=0, num2=0): - if (type(num1) is not int or type(num2) is not int): + if type(num1) is not int or type(num2) is not int: return 0 return num1 + num2 diff --git a/lesson10/recursion.py b/lesson10/recursion.py index 246b35c..092e398 100644 --- a/lesson10/recursion.py +++ b/lesson10/recursion.py @@ -1,8 +1,8 @@ def add_one(num): - if (num >= 9): + print(num) return num + 1 total = num + 1 diff --git a/lesson11/scope.py b/lesson11/scope.py index d320d0d..c82501c 100644 --- a/lesson11/scope.py +++ b/lesson11/scope.py @@ -12,11 +12,12 @@ def another(): def greeting(name): nonlocal color + print(color) color = "red" print(color) - print(name) + print(name) #local priority - greeting("Dave") + greeting("Davee") another() diff --git a/lesson14/kansas.py b/lesson14/kansas.py index 7829fe0..7568410 100644 --- a/lesson14/kansas.py +++ b/lesson14/kansas.py @@ -22,5 +22,5 @@ def randomfunfact(): print(funfacts[int(index)]) -if __name__ == "__main__": - randomfunfact() + +randomfunfact() \ No newline at end of file diff --git a/lesson14/modules.py b/lesson14/modules.py index 1af30da..5c84c86 100644 --- a/lesson14/modules.py +++ b/lesson14/modules.py @@ -15,7 +15,7 @@ print(kansas.capital) kansas.randomfunfact() -print(__name__) -print(kansas.__name__) +print(__name__) #__main__ because it's the module we're running +print(kansas.__name__) #kansas (t1he imported module ) -rock_paper_scissors() +rock_paper_scissors() \ No newline at end of file diff --git a/lesson16/arcade.py b/lesson16/arcade.py index c4f35f6..1ae1652 100644 --- a/lesson16/arcade.py +++ b/lesson16/arcade.py @@ -3,22 +3,22 @@ from guess_number import guess_number -def play_game(name='PlayerOne'): +def play_game(name="PlayerOne"): welcome_back = False while True: - if welcome_back == True: + if welcome_back == True: #Initially False print(f"\n{name}, welcome back to the Arcade menu.") playerchoice = input( - "\nPlease choose a game:\n1 = Rock Paper Scissors\n2 = Guess My Number\n\nOr press \"x\" to exit the Arcade\n\n" + '\nPlease choose a game:\n1 = Rock Paper Scissors\n2 = Guess My Number\n\nOr press "x" to exit the Arcade\n\n' ) if playerchoice not in ["1", "2", "x"]: print(f"\n{name}, please enter 1, 2, or x.") return play_game(name) - welcome_back = True + welcome_back = True #set to True only after entering a valid choice if playerchoice == "1": rock_paper_scissors = rps(name) @@ -39,12 +39,15 @@ def play_game(name='PlayerOne'): ) parser.add_argument( - '-n', '--name', metavar='name', - required=True, help='The name of the person playing the game.' + "-n", + "--name", + metavar="name", + required=True, + help="The name of the person playing the game.", ) args = parser.parse_args() print(f"\n{args.name}, welcome to the Arcade! 🤖") - play_game(args.name) + play_game(args.name) diff --git a/lesson16/guess_number.py b/lesson16/guess_number.py index 68e5ed1..9af767c 100644 --- a/lesson16/guess_number.py +++ b/lesson16/guess_number.py @@ -2,7 +2,7 @@ import random -def guess_number(name='PlayerOne'): +def guess_number(name="PlayerOne"): game_count = 0 player_wins = 0 @@ -11,7 +11,8 @@ def play_guess_number(): nonlocal player_wins playerchoice = input( - f"\n{name}, guess which number I'm thinking of... 1, 2, or 3.\n\n") + f"\n{name}, guess which number I'm thinking of... 1, 2, or 3.\n\n" + ) if playerchoice not in ["1", "2", "3"]: print(f"{name}, please enter 1, 2, or 3.") @@ -20,9 +21,7 @@ def play_guess_number(): computerchoice = random.choice("123") print(f"\n{name}, you chose {playerchoice}.") - print( - f"I was thinking about the number {computerchoice}.\n" - ) + print(f"I was thinking about the number {computerchoice}.\n") player = int(playerchoice) @@ -79,8 +78,11 @@ def decide_winner(player, computer): ) parser.add_argument( - '-n', '--name', metavar='name', - required=True, help='The name of the person playing the game.' + "-n", + "--name", + metavar="name", + required=True, + help="The name of the person playing the game.", ) args = parser.parse_args() diff --git a/lesson16/rps.py b/lesson16/rps.py index 289d5d7..711456f 100644 --- a/lesson16/rps.py +++ b/lesson16/rps.py @@ -3,7 +3,7 @@ from enum import Enum -def rps(name='PlayerOne'): +def rps(name="PlayerOne"): game_count = 0 player_wins = 0 python_wins = 0 @@ -19,7 +19,8 @@ class RPS(Enum): SCISSORS = 3 playerchoice = input( - f"\n{name}, please enter... \n1 for Rock,\n2 for Paper, or \n3 for Scissors:\n\n") + f"\n{name}, please enter... \n1 for Rock,\n2 for Paper, or \n3 for Scissors:\n\n" + ) if playerchoice not in ["1", "2", "3"]: print(f"{name}, please enter 1, 2, or 3.") @@ -32,9 +33,7 @@ class RPS(Enum): computer = int(computerchoice) print(f"\n{name}, you chose {str(RPS(player)).replace('RPS.', '').title()}.") - print( - f"Python chose {str(RPS(computer)).replace('RPS.', '').title()}.\n" - ) + print(f"Python chose {str(RPS(computer)).replace('RPS.', '').title()}.\n") def decide_winner(player, computer): nonlocal name @@ -96,12 +95,14 @@ def decide_winner(player, computer): ) parser.add_argument( - '-n', '--name', metavar='name', - required=True, help='The name of the person playing the game.' + "-n", + "--name", + metavar="name", + required=True, + help="The name of the person playing the game.", ) args = parser.parse_args() rock_paper_scissors = rps(args.name) rock_paper_scissors() - diff --git a/lesson17/lambda.py b/lesson17/lambda.py index b205ca8..e70dd02 100644 --- a/lesson17/lambda.py +++ b/lesson17/lambda.py @@ -1,22 +1,33 @@ from functools import reduce -def squared(num): return num * num -# lambda num : num * num + +# lamba function is a single expression that returns a value + +squared_lambda = ( + lambda num: num * num +) # equivalent to def squared_lambda(num): return num * num +print(squared_lambda(2)) + + +def squared(num): + return num * num # lambda num : num * num print(squared(2)) -def add_two(num): return num + 2 -# lambda num : num + 2 +def add_two(num): + return num + 2 # lambda num : num + 2 print(add_two(12)) -def sum_total(a, b): return a + b -# lambda a, b : a + b +def sum_total(a, b): + return a + b +# lambda a, b : a + b + print(sum_total(10, 8)) ####################### @@ -29,14 +40,18 @@ def funcBuilder(x): add_ten = funcBuilder(10) add_twenty = funcBuilder(20) -print(add_ten(7)) -print(add_twenty(7)) +print(add_ten(7)) # 17 +print(add_twenty(7)) # 27 ######################## +# Higher order function - function that takes another function as an argument or returns a function. This allows for more flexible and reusable code. + numbers = [3, 7, 12, 18, 20, 21] +# map is a function built into Python and it receives a function as it's first argument and applies it to each item in the iterable. The second argument is an iterable. + squared_nums = map(lambda num: num * num, numbers) print(list(squared_nums)) @@ -44,7 +59,7 @@ def funcBuilder(x): ############################### odd_nums = filter(lambda num: num % 2 != 0, numbers) - +print(tuple(odd_nums)) print(list(odd_nums)) ############################# @@ -59,7 +74,7 @@ def funcBuilder(x): print(sum(numbers, 10)) -names = ['Dave Gray', 'Sara Ito', 'John Jacob Jingleheimerschmidt'] +names = ["Dave Gray", "Sara Ito", "John Jacob Jingleheimerschmidt"] char_count = reduce(lambda acc, curr: acc + len(curr), names, 0) diff --git a/lesson18/classes.py b/lesson18/classes.py index ef563aa..01448f6 100644 --- a/lesson18/classes.py +++ b/lesson18/classes.py @@ -1,48 +1,54 @@ -class Vehicle: - def __init__(self, make, model): +class Vehicle: # blueprint for Objects representing vehicles + def __init__( + self, make, model + ): # initialized function used to set properties of the class self.make = make self.model = model def moves(self): - print('Moves along..') + print("Moves along..") def get_make_model(self): print(f"I'm a {self.make} {self.model}.") -my_car = Vehicle('Tesla', 'Model 3') +my_car = Vehicle("Tesla", "Model 3") -# print(my_car.make) -# print(my_car.model) -my_car.get_make_model() +print(my_car.make) # accessing property of the my_car instance +print(my_car.model) +my_car.get_make_model() # method that is a function which is associated with the object. my_car.moves() -your_car = Vehicle('Cadillac', 'Escalade') +your_car = Vehicle("Cadillac", "Escalade") your_car.get_make_model() your_car.moves() +# Inheritance example class Airplane(Vehicle): def __init__(self, make, model, faa_id): - super().__init__(make, model) + super().__init__(make, model) # inherit from parent class self.faa_id = faa_id def moves(self): - print('Flies along..') + print("Flies along..") class Truck(Vehicle): def moves(self): - print('Rumbles along..') + print("Rumbles along..") class GolfCart(Vehicle): - pass + pass # inherit everything as is -cessna = Airplane('Cessna', 'Skyhawk', 'N-12345') -mack = Truck('Mack', 'Pinnacle') -golfwagon = GolfCart('Yamaha', 'GC100') +print("") +print("") + +cessna = Airplane("Cessna", "Skyhawk", "N-12345") +mack = Truck("Mack", "Pinnacle") +golfwagon = GolfCart("Yamaha", "GC100") cessna.get_make_model() cessna.moves() @@ -51,8 +57,12 @@ class GolfCart(Vehicle): golfwagon.get_make_model() golfwagon.moves() -print('\n\n') +print("\n\n") + +# Polymorphism example using a list of objects +# The ability to behave differently in response to different input messages +# They all have a 'get_make_model' and a'moves' method but they have different responses to these methods for v in (my_car, your_car, cessna, mack, golfwagon): v.get_make_model() v.moves() diff --git a/lesson19/exceptions.py b/lesson19/exceptions.py index f29334b..30778ce 100644 --- a/lesson19/exceptions.py +++ b/lesson19/exceptions.py @@ -10,12 +10,16 @@ class JustNotCoolError(Exception): # if not type(x) is str: # raise TypeError("Only strings are allowed.") except NameError: - print('NameError means something is probably undefined.') + print("NameError means something is probably undefined.") except ZeroDivisionError: - print('Please do not divide by zero.') + print("Please do not divide by zero.") except Exception as error: print(error) else: - print('No errors!') + print("No errors!") finally: print("I'm going to print with or without an error.") + + +# raise in Python is the same as throw in JS +# except are used for general error handling diff --git a/lesson20/bank_accounts.py b/lesson20/bank_accounts.py index e96035e..89cee5c 100644 --- a/lesson20/bank_accounts.py +++ b/lesson20/bank_accounts.py @@ -6,14 +6,15 @@ class BankAccount: def __init__(self, initial_amount, acct_name): self.balance = initial_amount self.name = acct_name - print( - f"\nAccount '{self.name}' created.\nBalance = ${self.balance:.2f}") + print(f"\nAccount '{self.name}' created.\nBalance = ${self.balance:.2f}") def get_balance(self): print(f"\nAccount '{self.name}' balance = ${self.balance:.2f}") def deposit(self, amount): - self.balance = self.balance + amount + if amount <= 0: + print("\nInvalid deposit amount.") + return print("\nDeposit complete.") self.get_balance() @@ -32,34 +33,36 @@ def withdraw(self, amount): print("\nWithdraw complete.") self.get_balance() except BalanceException as error: - print(f'\nWithdraw interrupted: {error}') + print(f"\nWithdraw interrupted: {error}") def transfer(self, amount, account): - try: - print('\n**********\n\nBeginning Transfer.. 🚀') - self.viable_transaction(amount) - self.withdraw(amount) - account.deposit(amount) - print('\nTransfer complete! ✅\n\n**********') - except BalanceException as error: - print(f'\nTransfer interrupted. ❌ {error}') + try: + print("\n**********\n\nBeginning Transfer.. 🚀") + self.viable_transaction(amount) + self.withdraw(amount) + account.deposit(amount) + print("\nTransfer complete! ✅\n\n**********") + except BalanceException as error: + print(f"\nTransfer interrupted. ❌ {error}") + -class InterestRewardsAcct(BankAccount): +class InterestRewardsAcct(BankAccount): def deposit(self, amount): self.balance = self.balance + (amount * 1.05) print("\nDeposit complete.") self.get_balance() + class SavingsAcct(InterestRewardsAcct): - def __init__(self, initial_amount, acct_name): + def __init__(self, initial_amount, acct_name): super().__init__(initial_amount, acct_name) self.fee = 5 - def withdraw(self, amount): - try: + def withdraw(self, amount): + try: self.viable_transaction(amount + self.fee) - self.balance = self.balance - (amount + self.fee) + self.balance = self.balance - (amount + self.fee) print("\nWithdraw completed.") - self.get_balance() + self.get_balance() except BalanceException as error: - print(f'\nWithdraw interrupted: {error}') + print(f"\nWithdraw interrupted: {error}") diff --git a/lesson20/oop_project.py b/lesson20/oop_project.py index 1dc589f..7a105d7 100644 --- a/lesson20/oop_project.py +++ b/lesson20/oop_project.py @@ -8,25 +8,27 @@ Sara.deposit(500) -Dave.withdraw(10000) Dave.withdraw(10) +Dave.withdraw(10000) Dave.transfer(10000, Sara) Dave.transfer(100, Sara) -Jim = InterestRewardsAcct(1000, "Jim") +Jim = InterestRewardsAcct(100, "Jim") + +# Jim.get_balance() -Jim.get_balance() +# Jim.deposit(100) -Jim.deposit(100) +# Jim.transfer(100, Dave) -Jim.transfer(100, Dave) +# Blaze = SavingsAcct(1000, "Blaze") -Blaze = SavingsAcct(1000, "Blaze") +# Blaze.get_balance() -Blaze.get_balance() +# Blaze.deposit(100) -Blaze.deposit(100) +# Blaze.transfer(10000, Sara) +# Blaze.transfer(1000, Sara) -Blaze.transfer(10000, Sara) -Blaze.transfer(1000, Sara) +print("\n\n**********")