1 answer

Programming language in python Solicit string from the keyboard one after another till you get a...

Question:

programming language in python
Solicit string from the keyboard one after another till you get a null value input (null means nothing a Carriage Return <CR>
Solicit string from the keyboard one after another till you get a null value input (null means nothing a Carriage Return <CR> hit). During the cycle, determine the length of the key-in. If it is an odd number length (1, 3, 5, ...) then add a colon (":") before concatenating with the next string, otherwise when even number (2, 4, 6, ...) add a dash (") at the end before connecting. Discard (not re-solicit, simply ignore) all numeric input values (any valid integer & float). Garbage entry is considered valid string. For the last entry do not append dash or colon. (Helping video is here, turn off computer volume) At the end, print out in one line the concatenated resulting string. See illustration on the right. 23.45 Hello World 801 $2320 'OK' 511 %#6& Wmm <CR> Hello World: $2320:'OK'-4366 mm: OK

Answers

result=""
ip=input()
while len(ip)>0:
try:
float(ip)
except ValueError:
if len(ip)%2==0:
result+=ip+'-'
else:
result+=ip+':'
ip=input()
  
print(result[:-1])

result= ip=input() while len(ip)>0: try: float(ip) except ValueError: if len(ip)%2==0: result+=ip+- else: result+=ipt:

.

Similar Solved Questions

1 answer
Question 3 (1 point) Given the following informtion: Long term assets = $350,000, Revenues = $1,200,000,...
Question 3 (1 point) Given the following informtion: Long term assets = $350,000, Revenues = $1,200,000, Depreciation - $100,000, Short Term Assets = $300,000. Expenses = $950,000, Interest - $25,000, Short Term Liabilities = $100,000, Equity = ?, Long Term Debt = $400,000, Tax Rate - 30%, What is n...
1 answer
Q1. True or False? The PhRMA trade association has regulated itself to limit gifts to physicians...
Q1. True or False? The PhRMA trade association has regulated itself to limit gifts to physicians of no more than $250. True False Q2. True or False? In industrial buying situations, the initiator is usually the key decision maker in the buying group. True False Q3. True or False? The Hispanic popula...
1 answer
Which of the following is NOT a characteristic of a market in equilibrium? Multiple Choice Sellers...
Which of the following is NOT a characteristic of a market in equilibrium? Multiple Choice Sellers can sell as many units as they want at the equilibrium price. Neither buyers nor sellers want the price to change. There s There is neither excess supply nor excess demand. Buyers can buy as many units...
1 answer
Three charged particles are placed at the corners of an equilateral triangle 6.3 m side (figure)....
Three charged particles are placed at the corners of an equilateral triangle 6.3 m side (figure). The charges are Q1 = 9.1 µC, Q2 = –8.5 µC and Q3 = –2.3 µC. Calculate the magnitude of the net force on charge Q2 due to the other two. (in milli Newton). Tres partí...
1 answer
Consider a series of four long concentric cylinders, each carrying the uniform current I in alternating...
consider a series of four long concentric cylinders, each carrying the uniform current I in alternating directions into and out of the page, as shown in the figure. For this problem, each cylinder is considered to be infinitely thin! let r denote the radial distance from the center of the cylinders....
1 answer
What is the longest wavelength of light that can cause the release of electrons from a...
What is the longest wavelength of light that can cause the release of electrons from a metal that has a work function of 3.40 eV ?...
1 answer
0 9 0 -12 0 10 0 0 Question 5. Find AB where and B 0 2 2 30 -1 3 5 -1 -1 00-2 Is BA well defined? Explain. Question 6. Prove that if A and B are invertible n x n matrices, the is invertible...
0 9 0 -12 0 10 0 0 Question 5. Find AB where and B 0 2 2 30 -1 3 5 -1 -1 00-2 Is BA well defined? Explain. Question 6. Prove that if A and B are invertible n x n matrices, the is invertible and (AB) B-1A Question 7, prove that if A is an invertible n × n matrix, then A-1 1-A. invertible and (A...
1 answer
Who was Michael Faraday? And explain in detail one of his experiments?
Who was Michael Faraday? And explain in detail one of his experiments?...
1 answer
Required information [The following information applies to the questions displayed below.] During April, the first production...
Required information [The following information applies to the questions displayed below.] During April, the first production department of a process manufacturing system completed its work on 340,000 units of a product and transferred them to the next department. Of these transferred units, 68,000 ...
1 answer
Advantages of using performance indices v. variance analysis?
advantages of using performance indices v. variance analysis?...
1 answer
23. The waveforms shown for the window comparator in Figure 8-65 are measured. Determine if the...
23. The waveforms shown for the window comparator in Figure 8-65 are measured. Determine if the output waveform is correct and, if not, specify the possible faults Al D. A2 +2 V 10 kn FIGURE 8-65...
1 answer
There has been much debate in American society in the past several decades as to whether...
There has been much debate in American society in the past several decades as to whether the Supreme Court has overreached its authority granted to it in the US Constitution. Do you think the Supreme Court has done so or is it operating within its constitutional boundaries? Defend your position with...
1 answer
Consider the reaction. A(aq) = 3 B(aq) K. = 6.30 x 10-6 at 500 K If...
Consider the reaction. A(aq) = 3 B(aq) K. = 6.30 x 10-6 at 500 K If a 3.50 M sample of A is heated to 500 K, what is the concentration of B at equilibrium? [B] = M...
1 answer
A company preparing for a Chapter 7 liquidation has the following liabilities: • Note payable A...
A company preparing for a Chapter 7 liquidation has the following liabilities: • Note payable A of $110,000 secured by land having a book value of $60,000 and a fair value of $80,000. . Note payable B of $140,000 secured by a building having a $70,000 book value and a $50,000 fair value. •...
1 answer
This exercise pulls data from the NANOOS dataset of research buoys in the columbia river along...
this exercise pulls data from the NANOOS dataset of research buoys in the columbia river along the southern part of washington state. the data relate to the growth of phytoplankton, bacteria, and similar microorganisms in the water Names Math 146, Winter 2019 Group Task #4-Correlations and Regre...
1 answer
4 pts Question 8 Use StatKey to find the endpoint(s) on a N(0, 1) density with...
4 pts Question 8 Use StatKey to find the endpoint(s) on a N(0, 1) density with the given property. The area between is about 0.92. Endpoints - + [Select) The area to the left of the endpoint is about 0.2. Endpoint = [Select) Use StatKey to find the endpoint(5) property. ✓ [ Select ] 1.417 1.7...