What would the output of the program regtest.py be if it was given the input file...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What would the output of the program regtest.py be if it was given the input file addresses.txt (below). regtest.py import re addressRegex = re.compile(r'''( (\d{2}) \s (\w+) )'', re. VERBOSE) fileobj open ('addresses.txt') data = fileobj. readlines () for address in data: Answer: address address. strip () mo if mo: addressRegex.search (address) print ('Found: '+mo.group () ) addresses.txt 30 Python St, Jupyter, 2001 300 Python St, Jupyter Springs, 2010 3 Python St, Jupyter, 2010 30 Python Street, Jupyter, 2001 30a Python Street, Jupyter, 2001 3 Python Package Index, Jupyter, 2010 Provide code for changes that would be required for regtest.py to completely and specifically match each of the part of the address (number, street, suburb and postcode) as given in the input file. What would the output of the program regtest.py be if it was given the input file addresses.txt (below). regtest.py import re addressRegex = re.compile(r'''( (\d{2}) \s (\w+) )'', re. VERBOSE) fileobj open ('addresses.txt') data = fileobj. readlines () for address in data: Answer: address address. strip () mo if mo: addressRegex.search (address) print ('Found: '+mo.group () ) addresses.txt 30 Python St, Jupyter, 2001 300 Python St, Jupyter Springs, 2010 3 Python St, Jupyter, 2010 30 Python Street, Jupyter, 2001 30a Python Street, Jupyter, 2001 3 Python Package Index, Jupyter, 2010 Provide code for changes that would be required for regtest.py to completely and specifically match each of the part of the address (number, street, suburb and postcode) as given in the input file.
Expert Answer:
Answer rating: 100% (QA)
Answer Here is a corrected version of the code import re add... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Verify that the functions are probability density functions for a continuous random variable X over the given interval. Determine the specified probability. f(x) = xe over [0, ), P(1 X 3)
-
If a CPA has completed the in-house training program at one of 14 different competitor CPA firms, Stonecutor and Company, CPAs will pay her a $20,000 signing bonus to switchover to working for...
-
What is the purpose of municipally provided WiMAX, and why is it in competition with subscriber broadband services?
-
What lump-sum amount of interest will be paid on a \($10,000\) loan that was made on 1 June 2011 and repaid on 1 September 2015, with ordinary simple interest at 10% per year?
-
Cook Corporation manufactures plastic garbage cans. In a typical year, the firm produces between 40,000 and 50,000 cans. At this level of production, fixed costs are $10,000 and variable costs are $2...
-
A business has a cost of equity of 9.5 percent and a pretax cost of debt of 5.4 percent. The debt-equity ratio is 1.15 and the tax rate is 25 percent. What is the unlevered cost of capital?
-
The Profit & Gambit Co. has a major product that has been losing money recently because of declining sales. In fact, during the current quarter of the year, sales will be 4 million units below the...
-
3. Design a frame that is 3 degrees statically indeterminate. Apply a load of your choice (no numbers). Sketch the deformed shape of the frame and list the degrees of freedom including axial...
-
During World War II, 408,000 U.S. American military personnel died while on duty and 375,000 civilian Americans died because of accidents in the United States. Should we conclude that fighting a war...
-
Why did the people of the United Kingdom want to exit the European Union?
-
A study found that the grade point averages (GPAs) of women at all-women colleges tend to be higher than the GPAs of women at coeducational colleges, and concluded that women do better when they...
-
What is the name of the most recent trade agreement among 54 nations across the continent of Africa?
-
A 1950s study found that married men were in better health than men of the same age who never married or were divorced, suggesting that the healthiest path is for a man to marry and never divorce...
-
At June 30, Otto Company reports the following inventory purchases for the month of June. At June 1, beginning inventory included 50 units at $262.50. Purchases: June 8 55 units @ $5.50 $ 302.50 June...
-
Graph the following conic sections, labeling vertices, foci, directrices, and asymptotes (if they exist). Give the eccentricity of the curve. Use a graphing utility to check your work. 10 5 + 2 cos 0
-
Consider the following relation: CLASS- LIST (STUDENT#, CLASS#, STUDENT- NAME, STUDENT- MAJOR, CLASS- TIME, and CLASSROOM) Required a. Suppose that we wish to add a new class time and room (i. e., a...
-
The following figure is a portion of a business process diagram for an order- entry system. 1. Pull Goods. 2. Verify credit. 3. Shipping report. 4. Customer purchase order. 5. Notify customer. 6....
-
The Wadswad Corporation manufactures both standard and customized electrical control boards for automated manufacturing machinery. The company was started by an electrical engineer and a salesman for...
-
Sketch a force acting at point \(\mathrm{P}\) in Figure Q8.2 that would make the rod be in static equilibrium. Is there only one such force? P - FIGURE Q8.2
-
Rank in order, from least stable to most stable, the three objects shown in the figure. The positions of their centers of gravity are marked. (For the centers of gravity to be positioned like thi s,...
-
A 1.0 kg weight is suspended from a spring, stretching it by 5.0 cm. How much does the spring stretch if the 1.0 kg weight is replaced by a 3.0 kg weight? A. 5.0cm B. 10.0cm C. 15.0cm D. 20.0cm
Study smarter with the SolutionInn App