diff --git a/Bonus.py b/Bonus.py new file mode 100644 index 0000000..7b55545 --- /dev/null +++ b/Bonus.py @@ -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]) diff --git a/Lab.py b/Lab.py new file mode 100644 index 0000000..6ec4c11 --- /dev/null +++ b/Lab.py @@ -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))) +