(Solved) : Objective Learn String Methods Work Python Documentation Specifics Perform Simple Google S Q41414131 . . .

Objective

Learn about String methods
Work with the Python documentation

Specifics

Perform a simple Google search (or use any other search engine)on “Python String methods”. One of the first links will be to thePython webpage detailing the built-in data types. This pagecontains a description of the methods available in Stringvariables. You may use other webpages for this assignment, but youneed to be aware of the official documentation for thelanguage.

The webpage lists methods that are part of every Stringvariable. The methods can return information about the data in theString variable, such as an integer or a Boolean value, or evenreturn a new String value. NONE of the method will alter the valuein the variable.

Given a String variable x identify the method, or methods, whichcan be used to perform the following tasks. Quite often there aretwo, and possibly more, methods that could be used perform thetasks. Write the function or method, with the argument(s) (ifneeded) to perform the tasks. Don’t worry about using the results,just demonstrate how to use the function/method. For example, ifthe question was “Determine if x starts with a ‘q’”, the methodcall would be:
x.startswith(‘q’)

  1. Determine how many characters are in x.

  2. Determine the position of the first occurrence of the letter “q”in x.

  3. Determine if the last character in x is the letter “q”.

  4. Get a copy of x in all upper case letters.

  5. Is x already comprised of all upper case letters.

  6. Get a copy of x in all lower case letters.

  7. Determine if x contains any characters at all.

  8. Get a copy of x with the first blank space (” “)changed to adash (“-“).

  9. Get a copy of x with all blank spaces (” “) changed to dashes(“-“).

  10. Break up x into one or more values by a delimiter. For example,if a string

    contained “a,b,c”, how could your program return the values “a”and “b” and “c”?

  11. Determine if x “looks like” a number. Remember, the int()function crashes if

    the supplied string doesn’t “look like” a number.

  12. Determine if x “looks like” a name, meaning it contains only thecharacters ‘a’

    through ‘z’, either upper or lower case.

Expert Answer


Answer to Objective Learn about String methods Work with the Python documentation Specifics Perform a simple Google search (or use…