Ace - AI Tutor
Ask Our Educators
Textbooks
My Library
Flashcards
Scribe - AI Notes
Notes & Exams
Download App
anthony b-ez

anthony b.

Divider

Questions asked

BEST MATCH

In this lab you will create a simple program which uses a stack to determine if a string is a palindrome. Step 1 In palindrome.py, strip() takes a string as input and returns it with all punctuation and spaces removed. The class string contains the member variable punctuation that contains the common punctuation characters. The string function replace() allows you to specify a character in a string and have it replace all occurrences of that character with another character. Add this loop to strip() to remove the punction from the starting string: for char in string.punctuation: startString = startString.replace(char, '') Inspired by the code above, determine a way to remove all the spaces from the string and add that to strip()as well. Step 2 isPalindrome() returns True or False indicating if the given string is or is not a palindrome. Write the code to do the following: 1. Strip the punctuation and spaces from the string. 2. Convert the string to lower case. 3. Create an ArrayStack stack and add all the characters in the string to it in order (add index 0 first, index 1 second, etc). In other words, the last character in the string should be the top of the stack. 4. We can use a stack to test if a string is a palindrome by pulling the characters off the stack one-by-one and comparing them with the string in order from index zero. In other words, we're using the stack to create a completely backward version of the string which we then compare one character at a time to the original string. Return True or False as appropriate. """ File: palindrome.py """ import string from arraystack import ArrayStack def strip(startString): """ Removes all common punctuation and spaces from the given string and returns the resulting string. """ # STEP 1 return startString def isPalindrome(startString): """Returns True if string is a palindrome or False otherwise.""" # STEP 2 def main(): while True: startString = input("Enter a string or Return to quit: ") if startString == "": break elif isPalindrome(startString): print("It's a palindrome") else: print("It's not a palindrome") if __name__ == '__main__': main()

View Answer
divider
BEST MATCH

QUESTION 3 · 1 POINT Use the second Taylor polynomial for $f(x) = \sqrt{x}$ at $x = 2$ to estimate $\sqrt{3}$. Round your answer to four decimal places if necessary. Provide your answer below: $\sqrt{3} \approx$

View Answer
divider
BEST MATCH

Computers can only facilitate nursing care and are not a substitute for it. Which human tasks cannot be performed by computers? Select all that apply.

View Answer
divider
BEST MATCH

Name the following organic compounds: compound name CH$_3$ CH$_2$ CH$_3$ CH$_3$—C—CH$_2$—C—CH$_3$ CH$_3$ CH$_3$ CH$_3$ CH$_3$ CH$_3$—C—CH$_2$—CH$_2$ CH$_3$ CH$_3$ CH$_3$—CH—CH—CH$_2$—CH$_3$ CH$_3$

View Answer
divider
BEST MATCH

If labor in France is more productive than labor in Italy in all areas of production, France will not have a comparative advantage in any good. Question 11Select one: True False

View Answer
divider
BEST MATCH

When a retailer is composed of independent store owners that have banded together to reap the benefits of belonging to a larger organization, it is called a Multiple Choice cooperative. sole proprietorship. joint venture. partnership.

View Answer
divider
BEST MATCH

It is given that for a value of \( k \) \( 16 x^{2}-24 x+10=k \) has exactly one answer for x Find this answer for x If the answer is not a whole number, give answer in decimal form

View Answer
divider
BEST MATCH

Question 91 Seeking out treatment modalities from various evidenced-based clinical models to best fit the patient characteristics in the treatment of children in psychotherapy is known as which approach? Regulatory Approach Trauma Approach General Approach Common Elements Approach

View Answer
divider
BEST MATCH

training exercises could include aerobic, resistance, flexibility, and/or sports activities, depending on the specific goals of the exercise session occur during Question 14 options: Cool Down Phase Warm-up Phase Conditioning Phase Acceleration Phase

View Answer
divider
BEST MATCH

Texts: 1. Assume α is opposite side a, β is opposite side b, and γ is opposite side c. Solve the triangle, if possible. Round your answers to the nearest tenth. (If not possible, enter IMPOSSIBLE.) α = 35°, γ = 59°, a = 10, β = °, c = b = 2. 2. Assume α is opposite side a, β is opposite side b, and γ is opposite side c. Solve the triangle, if possible. Round your answers to the nearest tenth. (If not possible, enter IMPOSSIBLE.) α = 60°, β = 60°, γ = 60°, a = b = c = 3. 3. Assume α is opposite side a, β is opposite side b, and γ is opposite side c. Solve the triangle, if possible. Round your answers to the nearest tenth. (If not possible, enter IMPOSSIBLE.) b = 9, β = 94°, γ = 30°, α = °, a = c = 4. Assume α is opposite side a, β is opposite side b, and γ is opposite side c. Determine whether there is no triangle, one triangle, or two triangles. Then solve each triangle, if possible. Round each answer to the nearest tenth. (If not possible, enter IMPOSSIBLE.) α = 113°, a = 17, b = 28. 5. Assume α is opposite side a, β is opposite side b, and γ is opposite side c. Determine whether there is no triangle, one triangle, or two triangles. Then solve each triangle, if possible. Round each answer to the nearest tenth. (If not possible, enter IMPOSSIBLE.) b = 4.1, c = 5.7, γ = 80°.

View Answer
divider