Question: Write a python program that takes 10 integers as input from the user. Your program should then create and print a tuple based on
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.
Step by Step Solution
3.38 Rating (151 Votes )
There are 3 Steps involved in it
Python version 38 read the input of 10 integers separated by spaces as a string numberstr input extr... View full answer
Get step-by-step solutions from verified subject matter experts
