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 Bonus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prog_language = "Python is a powerful and versatile programming language widely used for web development and data science"
word_language = "programming"
print("Length of the sentence is:",len(prog_language))
print("The first word in the sentence is:",prog_language[0:6])
print("The number of times the word appers in the sentence is:",prog_language.count(word_language))
print("The sentence by Uppercase letters:",prog_language.upper())
print("The sentence by Lowercase letters:",prog_language.lower())
new_sentence = prog_language.replace("Python","Java")
print("The new sentence :",new_sentence)
print("The last letter of the sentence is :",new_sentence[-1])
11 changes: 11 additions & 0 deletions Lab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
price,quantity,tax_rate = 2.99 , 3 , 7.5
subtotal = price * quantity
tax = subtotal * tax_rate/100
total = subtotal + tax
print("Price of item : "'$'+str(price))
print("Quantity : "+str(quantity))
print("Tax rate : "+str(tax_rate)+"%")
print("\nSubtotal: $"+str(round(subtotal,2)))
print("Tax: $"+str(round(tax,2)))
print("Total: $"+str(round(total,2)))