From e6b0b976b42a79c4fbf514f515c5a8b43da979b3 Mon Sep 17 00:00:00 2001 From: Ken Schaefer Date: Thu, 21 Nov 2024 14:07:15 -0600 Subject: [PATCH] blockchain --- 2-basics/blockchain.py | 13 +++++++++++++ README.md | 17 ++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 2-basics/blockchain.py diff --git a/2-basics/blockchain.py b/2-basics/blockchain.py new file mode 100644 index 0000000..48cb4db --- /dev/null +++ b/2-basics/blockchain.py @@ -0,0 +1,13 @@ +blockchain = [] + +def get_last_blockchain_value(): + return blockchain[-1] + +def add_value(transaction_amount, last_transaction=[1]): + blockchain.append([last_transaction, transaction_amount]) + + +add_value(5.3) +add_value(2.8, get_last_blockchain_value()) + +print(blockchain) \ No newline at end of file diff --git a/README.md b/README.md index 5c1a17b..76bf36b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ # py-practical-guide -Code from the uDemy course \ No newline at end of file +Code from the uDemy course + +## Section 2 - Basics + +Components of the BlockChain + +- Data (coins) +- The Chain + +Data Types + +- Integer +- Float +- Boolean +- Strings +