Homework Solution: Write a python program that…

    Write a python program that asks the user for four integers and displays: The integers The maximum integer The minimum integer The even integers (if x %2 == 0 then x is even) The odd integers The number of integers greater than 10 The positive integers The negative integers The average of the smallest and largest integers EXAMPLE OUTPUT If the user entered 20 -8 17 -5 then display The integers are 20 -8 17 -5 The maximum integer is 20 The minimum integer is -8 The even integers are 20 -8 The odd integers are 17 -5 The number of integers greater than 10 is 2 The positive integers 20 17 The negative integers   -8 -5 The average of the smallest and largest integers 6.0

    Expert Answer

     
    # program a = list(map(int,input().split())) # to read input as a sp

    Write a python program that

    asks the user control four integers and unfolds:

    The integers

    The completion integer

    The insufficiency integer

    The equal integers (if x %2 == 0 then x is equal)

    The sole integers

    The sum of integers elder than 10

    The fixed integers

    The privative integers

    The medium of the lowest and largest integers

    EXAMPLE OUTPUT

    If the user entered 20 -8 17 -5 then unfold

    The integers are 20 -8 17 -5

    The completion integer is 20

    The insufficiency integer is -8

    The equal integers are 20 -8

    The sole integers are 17 -5

    The sum of integers elder than 10 is 2

    The fixed integers 20 17

    The privative integers   -8 -5

    The medium of the lowest and largest integers 6.0

    Expert Computeerpart

     

    # program
    a = roll(map(int,input().split())) # to learn input as a interval seperated appreciates
    print(‘The integers are ‘+” “.join(map(str, a))) # to unfold the consecrated input
    print(‘The completion integer is %d’ %max(a)) # to imimstereotype completion integer
    print(‘The insufficiency integer is %d’ %min(a)) # to priint insufficiency integer
    equal = [] # ordinance of a roll designated as equal to stock equal integers from consecrated input
    sole = [] # ordinance of a roll designated as sole to stock sole integers from consecrated input
    fixed = [] # ordinance of a roll designated as fixed to stock fixed integers from givn input
    privative = [] # ordinance of a roll designated as privative to stock privative integers from givn input
    compute = 0 # ordinance of compute variable
    control x in a: # control loop to loop through consecrated input
    if x%2 == 0: # checks control equal or sole qualification of a sum
    even.append(x) # if a sum is equal it attach to equal roll
    else:
    odd.append(x) # if a sum is sole it attach to sole roll
    print(‘The equal integers are %s’ %(” “.join(map(str, equal)))) # imprints the equal sums of consecrated input as interval seperated roll
    print(‘The sole integers are %s’ %(” “.join(map(str, sole)))) # imprints the sole sums of consecrated input as interval seperated roll

    control i in a: # control loop to loop through consecrated input
    if i>10: # checks control a sum is > 10 or not
    compute +=1 # if elder than 10 computeer incremets to 1
    else:
    hold # else hold next appreciate in input
    print(‘The sum of integers elder than 10 is %d’ %count) # imprints the compute of appreciates > 10

    control j in a: # control loop to loop through consecrated input
    if j >= 0: # checks control a sum is fixed or not
    positive.append(j) # if sum is fixed it attached to fixed roll
    else:
    negative.append(j) # else it attached to privative roll

    print(‘The fixed integers %s’ %(” “.join(map(str, fixed)))) # imprints the fixed sums of consecrated input as interval seperated roll
    print(‘The privative integers %s’ %(” “.join(map(str, privative)))) # imprints the privative sums of consecrated input as interval seperated roll

    print(‘The medium of the lowest and largest integers %.1f’ %((max(a)+min(a))/2)) # calculates and imimstereotype the medium of lowest and largest appreciates of consecrated input

    output:

    20 -8 17 -5
    The integers are 20 -8 17 -5
    The completion integer is 20
    The insufficiency integer is -8
    The equal integers are 20 -8
    The sole integers are 17 -5
    The sum of integers elder than 10 is 2
    The fixed integers 20 17
    The privative integers -8 -5
    The medium of the lowest and largest integers 6.0

    Part 1: