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
11 changes: 11 additions & 0 deletions StringLab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sentence = "Artificial Intelligence is an evolution that help human achieve their goals"
word = "evolution"
print (f"the lenght of sentence is:{len(sentence)}")
print(f"first occurrence index", sentence.find(word))
print(f"word counts:{sentence.count(word)}")
print(f"Uppercase:{sentence.upper()}")
print(f"Lowercase:{sentence.lower()}")
new_sentence = sentence.replace(word,"Progress")
print(f"new sentence:{new_sentence}")
print(f"last charecter: {sentence[-1]}")

13 changes: 13 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
price = 3
quantity = 4
tax_rate = 0.020
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}%")
print()
print (f"Subtotal: ${subtotal:.2f}")
print (f"Tax: ${tax:.2f}")
print (f"Total: ${total:.2f}")