Question

Python)) Assume the variable x to be with the string of "Day by day, dear GOD,...

Python))

  1. Assume the variable x to be with the string of "Day by day, dear GOD, of thee three things I pray - to see thee more clearly; to love thee more dearly; to follow thee more nearly, Day by Day - St. Richard of ChiChester”.

Use the Python String Methods: str(), upper(), lower(), count(), find(), replace() & len(). Display the results.

  1. Write the program to determine how much to tip the server in a restaurant. The tip should be 15% of the bill, with a minimum of $2.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

x="Day by day, dear GOD, of thee three things I pray - to see thee more clearly; to love thee more dearly; to follow thee more nearly, Day by Day - St. Richard of ChiChester"

print("Upper : ",x.upper())

print("Lower : ",x.lower())

print("Length : ",len(x))

print("Str : ",str(x))

print("Count ",x.count("e"));

print("Find ",x.find("e"))

print("Count ",x.replace("day","DAY"))

print("Str : ",str(x))

Answer 2:

bill = float(input("Enter bill amount : "))

tip=bill *0.15

if(tip<2):

tip=2

print("Tip : ",tip)

Note : If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
Python)) Assume the variable x to be with the string of "Day by day, dear GOD,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT