Write a python program that takes 10 integers as input from the user. Your program should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a python program that takes 10 integers as input from the user. Your program should then create and print a tuple based on the following two conditions: a. If the sum of all the inputs is even, then create a tuple of those inputs by arranging the even numbers at the start of the tuple and odd numbers at the end of the tuple. b. If the sum of all the inputs is odd, then the odd numbers will be at the start and even numbers at the end of the tuple. Sample Input 1: 86 64 95 43 52 27 38 77 19 44 Sample Output 1: (95,43,27,77,19,86,64,52,38,44) Explanation: Sum of the inputs is 545. Since the sum is odd, odd inputs are arranged at the start and even inputs are arranged at the end of the tuple. Write a python program that takes 10 integers as input from the user. Your program should then create and print a tuple based on the following two conditions: a. If the sum of all the inputs is even, then create a tuple of those inputs by arranging the even numbers at the start of the tuple and odd numbers at the end of the tuple. b. If the sum of all the inputs is odd, then the odd numbers will be at the start and even numbers at the end of the tuple. Sample Input 1: 86 64 95 43 52 27 38 77 19 44 Sample Output 1: (95,43,27,77,19,86,64,52,38,44) Explanation: Sum of the inputs is 545. Since the sum is odd, odd inputs are arranged at the start and even inputs are arranged at the end of the tuple.
Expert Answer:
Answer rating: 100% (QA)
Python version 38 read the input of 10 integers separated by spaces as a string numberstr input extr... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
What can you say about this? in a conversational way The Philippines, being situated in the Ring of Fire, is vulnerable to typhoons, earthquakes, and volcanic eruptions. This is why it is important...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Modern networking and database technologies have enabled the widespread use of SaaS. In thinking through security and risk implications, how do you think SaaS companies should handle all of your...
-
How would this photo be different if the two people were both Americans?
-
Calculate the standard molar entropy of xenon gas at (a) 100 K, (b) 298.15 K.
-
The square-threaded bolt is used to join two plates together. If the bolt has a mean diameter of d = 20 mm and a lead of l = 3 mm. determine the smallest torque M required to loosen the bolt if the...
-
The study recorded whether participants were female or male \((S e x=F\) or M), and we see that 33 of the 165 females and 42 of the 99 males allowed the pressure to reach its maximum level of \(300...
-
Cardinal Company is considering a project that would require a $2,975,000 investment in equipment with a useful life of five years. At the end of five years, the project would terminate and the...
-
2.) What is the specific goal of this lab? Exactly what question are you trying to answer? Be as specific as possible. ("To learn about topic X..." is not specific!) 3.) What specific measurements or...
-
The majority of forensic accounting practice involves the valuation of some type of damages or value of a business. Economic damages are a salient service provided by forensic accountants. Lost...
-
On December 31, 2020, Sheridan Company had $1,303,000 of short-term debt in the form of notes payable due February 2, 2021. On January 21, 2021, the company issued 25,400 shares of its common stock...
-
Where do companies generally explain the total amAshton is an investor looking at the income statements of two different companies. The first company has a very detailed income statement, and the...
-
Assume that ABCDEFG Corp. can either invest in Project A or Project B. Project A requires the initial investment of $51,000 and will generate $15,000 at Year 1, $14,500 at Year 2, $13,000 at Year 3,...
-
Assuming that the buyer is paying shipping costs for the goods, where in the purchases journal would the price of the goods purchased be entered?
-
In which environment would a chase strategy be not advantageous? Explain with Examples.
-
Is it really that difficult to communicate with someone of another gender, or do we just believe it's difficult because we've always been told it is? What is your take on this?
-
Part A Draw the products which result when oct-3-yne is heated in basic potassium permanganate solution. Check all that apply. D CHCH,CH,CO2 K D CHCH,CH,CH, CO2 K CH3CO K L CH,CH,CO, K Submit Request...
-
Cornell and Roberts are partners who agree to admit Stanley to their partnership. Cornell has a capital balance of $80,000 and Roberts has a capital balance of $120,000. Cornell and Roberts share net...
-
What are the advantages of using an extensible style language transformation instead of a cascading style sheet?
-
What are four ways in which ecommerce project management differs from traditional project management?
-
What are the design objectives for paper input forms, input screens, or Web-based fill-in forms?
-
On rare occasions, an organism may have three copies of a chromosome and therefore three copies of the genes on that chromosome (instead of the usual number of two copies). The alleles for each gene...
-
Outline the steps that occur when piRITS or piRISC silences transposable elements by repressing transcription and by directly inhibiting TE RNAs, respectively. What is the role of piRNAs in this...
-
Explain how the miR-200 family of miRNAs behave as tumorsuppressor genes. What happens when their expression is blocked or decreased?
Study smarter with the SolutionInn App