Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bouns.py
Original file line number Diff line number Diff line change
@@ -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])
17 changes: 17 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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 ")