Ethan H.

asked • 03/12/21

Strings methods reading

Unit_5_Strings

Readings: Python_by_Lambert

Chapter 4, Section 4.4 String Methods


 

 1.  Assume that the variable data refers to the string “Python rules!”.

    Use a string method from Table 4.2 to perform the following tasks:

  1. Obtain a list of the words in the string.
  2. Convert the string to uppercase.
  3. Locate the position of the string “rules”.
  4. Replace the exclamation point with a question mark.

 

  1. Using the value of data from Exercise 1, write the values of the following

    expressions:

  1. endswith('i')
  2. “ totally “.join(data.split())


1 Expert Answer

By:

Patrick B. answered • 03/13/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.