Question: Use def method only!!! Not Java 2) Given a string, return true if the first 2 chars in the string also appear at the end
Use def method only!!! Not Java


2) Given a string, return true if the first 2 chars in the string also appear at the end of the string, such as with "edited". Return false if it is not the case. Name the function and parameters as follows: frontAgain(str). Example: frontAgain ("edited") true 3) Given a string, return true if "bad" appears starting at index 0 or 1 in the string, such as with "badxxx" or "xbadxx" but not "xxbadxx". Return false otherwise. The string may be any length, including 0. Name the function and parameters as follow: hasBad (str). Example: hasBad ("xbadxx") hasBad ("xxbadxx") true false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
