From e51607e89db963f53dff810c76da1b942d39f8e0 Mon Sep 17 00:00:00 2001 From: Wajn Date: Tue, 17 Feb 2026 20:51:43 +0300 Subject: [PATCH] Completed arithmetic lab and bonus tasks --- bouns_ope.py | 10 ++++++++++ costumer_purchase.py | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 bouns_ope.py create mode 100644 costumer_purchase.py diff --git a/bouns_ope.py b/bouns_ope.py new file mode 100644 index 0000000..cd4823e --- /dev/null +++ b/bouns_ope.py @@ -0,0 +1,10 @@ +sentence:str = "I hope this camp brings me a lot of opportunities to grow, learn new skills, and achieve my goals" +word:str = "opportunities" +print(len(sentence)) +index = sentence.index(word) +print(index) +print(sentence.count(word)) +print(sentence.upper()) +print(sentence.lower()) +print(sentence.replace("opportunities", "good things")) +print(sentence[-1]) \ No newline at end of file diff --git a/costumer_purchase.py b/costumer_purchase.py new file mode 100644 index 0000000..417708b --- /dev/null +++ b/costumer_purchase.py @@ -0,0 +1,21 @@ + +print() + +price = 6.8 +quantity = 2 +tax_rate = 0.15 +subtotal = price * quantity +tax = subtotal * tax_rate +total = subtotal + tax + +print(f"Price of item: ${price:.2f}") +print(f"Quantity: {quantity}") +print(f"Tax rate: {tax_rate*100:.0f}%") + +print() + +print(f"Subtotal: ${subtotal:.2f}") +print(f"Tax: ${tax:.2f}") +print(f"Total: ${total:.2f}") + +print() \ No newline at end of file