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.
Get Free Quote!
303 Experts Online