Write a Python code snippet use 'if-elif' flow control along with a 'while' loop that will:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python code snippet use 'if-elif' flow control along with a 'while' loop that will: 1. Instruct a user to input a number that is greater than 0 and less than or equal to 10 and store the input as a floating-point value in a variable 2. If the input number is greater than O and less than or equal to 10, 1. use a 'while' loop in order to add the number to itself until the sum exceeds a value of 100. 2. After the sum has exceeded a value of 100, use the print statement to output the sum 3. Otherwise, output the message 'You did not enter a value between 1 and 10' 1 inval=float(input ('Input 2 if inval>0 and inval<=10: ▼ 2345 4, temp=0 while temp<=100: temp=temp+inval print (temp) print('You did not ente 6 7 ▾else: 8 9 Write a Python code snippet use 'if-elif' flow control along with a 'while' loop that will: 1. Instruct a user to input a number that is greater than 0 and less than or equal to 10 and store the input as a floating-point value in a variable 2. If the input number is greater than O and less than or equal to 10, 1. use a 'while' loop in order to add the number to itself until the sum exceeds a value of 100. 2. After the sum has exceeded a value of 100, use the print statement to output the sum 3. Otherwise, output the message 'You did not enter a value between 1 and 10' 1 inval=float(input ('Input 2 if inval>0 and inval<=10: ▼ 2345 4, temp=0 while temp<=100: temp=temp+inval print (temp) print('You did not ente 6 7 ▾else: 8 9
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Since the revelation of the scandal, Wells Fargo introduced a series of steps including ethics workshops and revision to the companys reward structure. Do you think these are adequate responses to...
-
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...
-
Develop a C# console application that implements two int arrays. One array will hold 10 randomly generated integer numbers, the second array will hold 10 integer numbers entered from the console....
-
Explain why entrepreneurial firms are often in a strong position to use combination strategies.
-
Equity Securities Lexington Co. has the following available-for-sale securities outstanding on December 31, 2010 (its first year of operations). During 2011 Summerset Company stock was sold for...
-
Butter contains esters of glycerol with several different carboxylic acids. We refer below to butyric (butanoic) acid (R = C3) for simplicity, but many of the acids have R= C15-C17.
-
(a) A gallon of gasoline contains about \(1.4 \times 10^{8} \mathrm{~J}\) of chemical energy. A car consumes this amount of gasoline in approximately \(30 \mathrm{~min}\) when cruising along a...
-
Ianthe Limited, a manufacturer of small tools, provided the following information from its accounting records for the year ended December 31, 2014: Additional information: 1. Included in the physical...
-
Kericho Sports Club has been operating for some time now. The treasurer analysed the cash book and produced the following Receipts and Payments account for the year ended 31st Dec. 2018. Receipts...
-
= On 1/1/X4, Phillip invested $1,100,000 in Sleeper's ordinary shares (35% owned). Sleeper reported: Assets $3,500,000 Liabilities 600,000 The book value of Sleeper's net assets approximated market...
-
Writ a java program that calculates the cost of individual items, including tax, and prints the grocery bill. Your program must do the following: 1. Ask the user to enter his/her full name. 2. Print...
-
Suppose X has an exponential distribution with = 5. Find the following probabilities: (a) P(X (b) P(X > 4) > .7) (c) P(X > .50) V V V
-
Assuming you have samples from normal populations with known variance, find (a) The degree of confidence used if n = 19, = 8, and the total width of a confidence interval for the mean is 3.29 units...
-
Suppose an obstetrician knows from past experience that the mean weight of a newborn baby is 7.5 lb with a standard deviation of 2 lb. The doctor randomly chooses five newborn babies. What is the...
-
A survey indicated that companies with fewer than 1,000 employees are expected to increase their spending by 20.4 %. Form a 99 % confidence interval for the unknown mean increase, assuming that the...
-
A company has just installed a new automatic milling machine. The time it takes the machine to mill a particular part is recorded for a sample of 9 observations. The mean time is found to be X =...
-
Part D. Q10) Chemical Mathematics, Dimensional Analysis or Factor-Label Method Use Factor Label (unit analysis) method and answer the following questions. Include all calculations to receive...
-
on 8 For the following set of lengths 130, 170, 160, 160, 150, 190 Third quartile is: et red d out of Select one: O a. 160 a question O b. 145 O c. 175 O d. 180
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1 and 2. On September 1, Irene opened a retail store that specializes in sports car...
-
Frank, age 35, and Joyce, age 34, are married and file a joint income tax return for 2012. Their salaries for the year total $83,000 and they have taxable interest income of $4,000. They have no...
-
Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....
-
Consider the following time series data. a. Construct a time series plot. What type of pattern exists in the data? b. Show the four-quarter and centered moving average values for this time series. c....
-
Refer to exercise 35. a. Deseasonalize the time series using the adjusted seasonal indexes computed in part (c) of exercise 35. b. Using Minitab or Excel, compute the linear trend regression equation...
-
The following table reports prices and usage quantities for two items in 2009 and 2011. a. Compute price relatives for each item in 2011 using 2009 as the base period. b. Compute an unweighted...
Study smarter with the SolutionInn App