1 answer

Complete the Python program below that performs the following operations. First prompt the user to input...

Question:

Complete the Python program below that performs the following operations. First prompt the user to input two integers, n and

Complete the Python program below that performs the following operations. First prompt the user to input two integers, n and m. If n<m, then print the odd positive integers that are less than m (in order, on a single line, separated by spaces). If man, then print the even positive integers that are less than n (in order, on a single line, separated by spaces). If neem, then print nothing. For instance, if the user enters 5 followed by 10, then the output will be 1 3 5 7 9. If the user enters 10 followed by 5, then the output will be 2 4 6 8. # get input from user int(input('Enter an integer: ')) int(input('Enter an integer: ')) n = m =

Answers

Program:

n = int(input("Enter a integer: ")) m = int(input("Enter a integer: ")) if n<m : #for loop for traversing the numbers for i in range(1,m): #it check the no is odd or not if i % 2 != 0: #if no is odd then print it print(i, end = " ") if m<n : for i in range(1,n): #it check the no is even or not if i%2==0 : #if no is even then print it { print(i, end = " ") }

Output:

Enter a integer: 10 Enter a integer: 5 2 4 6 8Enter a integer: 10 Enter a integer: 10Enter a integer: 5 Enter a integer: 10 1 3 5 7 9i wrote this program according to your specifications it take two numbers from the user and then check the condition and then print appropriate number.i provide you editable code and output also.

.

Similar Solved Questions

1 answer
A 5 kg collar is attached to a spring and it slides along a smooth bar....
A 5 kg collar is attached to a spring and it slides along a smooth bar. The spring has undeformed length of 35 cm and a constant k= 700 N/m. The collar is released from rest as shown below. Determine the force exerted by the rod on the collar when; a) The collar is at point A b) The collar is at poi...
1 answer
On January 1, 2019, Rodgers Company purchased $100,000 face value, 9%, 3-year bonds for $97,462.11, a...
On January 1, 2019, Rodgers Company purchased $100,000 face value, 9%, 3-year bonds for $97,462.11, a price that yields a 10% effective annual interest rate. The bonds pay interest semiannually on June 30 and December 31. Required: 1. Record the purchase of the bonds. 2. Prepare an inves...
1 answer
Exercise A3-20 (Algorithmic) Future Values of an Annuity Use Future Value Tables or your calculator to...
Exercise A3-20 (Algorithmic) Future Values of an Annuity Use Future Value Tables or your calculator to complete the requirements below. On December 31, 2020, you sign a contract to make annual deposits of $5,200 in an investment account that earns 10%. The first deposit is made on December 31, 2020....
1 answer
Determine the temperature at which the following decomposition reaction HgO (s)--> Hg (l) + (g) b...
Use the values from the following tables. Determine the temperature at which the following decomposition reaction HgO (s)--> Hg (l) + (g) becomes spontaneous, kJ mol- kJ mol-I SJ mol- K- CJJ mol-' K- formula as 619.2 61.4 as 20.8 28.0 20.8 2 um 186.9 Hafnium oxide 1088.2 0.0 31.8 75.9 175.0...
1 answer
Clearly explain it to me. Factor f(x) into linear factors given that k is a zero...
Clearly explain it to me. Factor f(x) into linear factors given that k is a zero of f(x). f(x) = 3x^3 + x^2 - 82x + 120; k = 4...
1 answer
Kate is at a T-shirt sale where she can buy one and get a second one for 30% off
Kate is at a T-shirt sale where she can buy one and get a second one for 30% off. She wants to buy two T-shirts listed at $19 each. How much will she pay?...
1 answer
In December 2016, Learer Company's manager estimated next year's total direct labor cost assuming 40 persons...
In December 2016, Learer Company's manager estimated next year's total direct labor cost assuming 40 persons working an average of 2,000 hours each at an average wage rate of $30 per hour. The manager also estimated the following manufacturing overhead costs for 2017. Indirect labor Factory ...
1 answer
Transactions for the month of June were:                                    Purchases&nbs
Transactions for the month of June were:                                    Purchases        &...
1 answer
An object with a mass of #5 kg# is hanging from an axle with a radius of #15 m#. If the wheel attached to the axle has a radius of #3 m#, how much force must be applied to the wheel to keep the object from falling?
An object with a mass of #5 kg# is hanging from an axle with a radius of #15 m#. If the wheel attached to the axle has a radius of #3 m#, how much force must be applied to the wheel to keep the object from falling?...
1 answer
Solve for CaCl2 and find the Error for NH4Cl and CaCl2 Compound Mass of Empty Calorimeter...
Solve for CaCl2 and find the Error for NH4Cl and CaCl2 Compound Mass of Empty Calorimeter & Lid Mass of Empty Calorimeter, Lid and cold water Mass water of Water NH CI 3.5463 CaCl2 542 Mass of vial and used Reagent Used | Mass of Empty Vial Mass of Reagent | 53SZ | 2 4 .97 17.363c 4s.oz? | 24-0...
1 answer
Question 1 (20 points) A standard Proctor test was performed on a soil which has a...
Question 1 (20 points) A standard Proctor test was performed on a soil which has a Gs = 2.70. The moisture content and total density results are shown in the table below. Moisture Content 16% Wet unit weight (KN/m3) 19.1 18% 20.3 20% 20.7 22% 20.0 24% 18.2 a. Calculate the dry unit weight for each s...
1 answer
Solve the problem using matrices. 3) The nutritional content per ounce for three foods is given...
Solve the problem using matrices. 3) The nutritional content per ounce for three foods is given in the table below. Fat (g/oz) Protein (g/oz) Fiber (g/oz) Food A 2 4 Food B 1 2 1 Food 8 16 5 What combination of these foods can provide exactly 14 grams of fat, 27 grams of protein, and 10 grams of fib...
1 answer
Assume the above cladogram of archosaurs (“ruling reptiles” - a potential misnomer) is accurate. Of the...
Assume the above cladogram of archosaurs (“ruling reptiles” - a potential misnomer) is accurate. Of the tips, only birds and crocodilians are still extant - all other tips are extinct. Q) Based on the above tree, which of the following is not considered a stem bird? Archaeopteryx Saurop...
1 answer
A rejection of an offer by the offeree is effective: A. At the moment that the...
A rejection of an offer by the offeree is effective: A. At the moment that the offeree signs the notice of rejection B. At the moment that the offeree dispatches the notice of rejection C. At the moment that the offeror receives the notice of rejection D. None of the above...
1 answer
Please show your work. Use the Chain Rule to find Oz/as and Oz/ot. z = e...
Please show your work. Use the Chain Rule to find Oz/as and Oz/ot. z = e cos(O), r = st, 0 = 55+ 45 de = 1...
1 answer
What nutritional recommendation would be given to a patient who is obese who has health problems...
what nutritional recommendation would be given to a patient who is obese who has health problems associated such as high blood pressure art problems and diabetes...
1 answer
Consider a haploid male of a certain ant species. This male’s karyotype contains a total of...
Consider a haploid male of a certain ant species. This male’s karyotype contains a total of 3 non- homologous chromosomes. It was estimated that the genome of this ant species contains approximately 12,000 protein-coding genes. a. Assuming genes are distributed evenly across chromosomes, on av...
1 answer
McGilla Golf has decided to sell a new line of golf clubs. The clubs will sell...
McGilla Golf has decided to sell a new line of golf clubs. The clubs will sell for $845 per set and have a variable cost of $405 per set. The company has spent $150,000 for a marketing study that determined the company will sell 60,000 sets per year for seven years. The marketing study also determin...
1 answer
PLease provide a 500 words reply. Judgment Case 9-1 Inventoriable costs; lower of cost or market;...
PLease provide a 500 words reply. Judgment Case 9-1 Inventoriable costs; lower of cost or market; retail inventory method LO9-1 , LO9-3 , LO9-4 Hudson Company, which is both a wholesaler and a retailer, purchases its inventories from various suppliers. Additional facts for Hudson's wholesale ope...