Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the function according to the specification. Use the test script testcurrency.py to aid your development before checking your answer below. Check the Function

   

Implement the function according to the specification. Use the test script testcurrency.py to aid your development before checking your answer below. Check the Function You may run this test multiple times. Check It! LAST RUN on 5/29/2023, 11:27:20 AM Call first_inside_quotes ('I said "Hello" to him.") crashed. def first_inside_quotes (s): ITTEIT Returns the first substring of s between two (double) quote characters Note that the double quotes must be part of the string. So "Hello World" is a precondition violation, since there are no double quotes inside the string. Example: first_inside_quotes ('A "B C" D') returns 'B C' Example: first_inside_quotes ('A "B C" D "E F" G') returns 'B C', because it only picks the first such substring. Parameter s: a string to search Precondition: s is a string with at least two (double) quote characters inside !! def test_first_inside_quotes(): Test procedure for first_inside_quotes print("Testing first_inside_quotes") #testcasel result-currency. first_inside_quotes ("s"') introcs.assert_equals( 's', result) #testcase2 result-currency. first_inside_quotes (' 1.58""9td') introcs.assert_equals(", result) #testcase3 result-currency.first_inside_quotes ('He"ll"o world') introcs.assert_equals( 'll', result) #testcase4 result-currency. first_inside_quotes ('T"o"mato "s" ') introcs.assert_equals( 'o', result)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information Systems

Authors: Marshall B. Romney, Paul J. Steinbart

13th edition

133428532, 978-0133428537

More Books

Students also viewed these Operating System questions

Question

=+a) What kind of study was this?

Answered: 1 week ago

Question

Calculate the missing values

Answered: 1 week ago