diff --git a/bouns.py b/bouns.py new file mode 100644 index 0000000..ee978e0 --- /dev/null +++ b/bouns.py @@ -0,0 +1,10 @@ +sentence = "Hello My Name Is Sadeem Alharbi, I Hope To Work In Tuwaiq Academy as a developer" +word = "Sadeem" +print ("length of sentence:", len(sentence)) +print ("first index of word:", sentence.find(word)) +print ("word count:", sentence.count(word)) +print ("uppercase:", sentence.upper()) +print ("lowercase:", sentence.lower()) +new_sentense = sentence.replace(word, "developer") +print("after replacement:", new_sentense ) +print("last character:", sentence[-1]) \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..bc50329 --- /dev/null +++ b/main.py @@ -0,0 +1,17 @@ +price = 2.99 +quantity = 3 +taxrate = 7.5 + +subtotal = price * quantity +tax = subtotal * (taxrate/100) +total = subtotal + tax + +print(f"price of item: ${price:.2f}") +print(f"quantity: {quantity}") +print(f"tax rate: {taxrate}%") + + +print (f"${subtotal:.2f} for the subtotal") +print(f"${tax:.2f} for the tax") +print(f"${total:.2f} for the total cost ") +