Write a function that accepts a string as an argument and


1. Assume choice references a string. The following if statement determines whether choice is equal to 'Y' or 'y': if choice == 'Y' or choice == 'y': Rewrite this statement so it only makes one comparison and does not use the or operator. (Hint: use either the upper or lower methods.)

2. Write a loop that counts the number of digits that appear in the string referenced by mystring.

3. Write a function that accepts a string as an argument and returns true if the argument ends with the substring ' .com '. Otherwise, the function should return false.

4. Write a function that accepts a string as an argument and displays the string backwards.

5. Assume mystring references a string. Write a statement that uses a slicing expression and displays the last 3 characters in the string.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Write a function that accepts a string as an argument and
Reference No:- TGS02222889

Now Priced at $25 (50% Discount)

Recommended (97%)

Rated (4.9/5)