Answer to Question #229074 in Python for Ramya

Question #229074
I was given 4 inputs 10,9,8,7
Here compare one by one
[10] here max 10
[10, 9] here max 10
[10, 9,8] here max 10
[10, 9,8,7] here max 10
So I want output as
10
10
10
10
1
Expert's answer
2021-08-24T04:43:21-0400
def main():
    a = int(input("enter first number"))
    b = int(input("enter second number"))
    c = int(input("enter third number"))
    d = int(input("enter forth number"))
    print(a)
    if a>b:
        print(a)
        if a>c:
            print(a)
            if a>d:
                print(a)
            else:
                print(d)
        else:
            print(c)
            if c>d:
                print(c)
            else:
                print(d)
    else:
        print(b)
        if b>c:
            print(b)
            if b>d:
                print(b)
            else:
                print(d)
        else:
            print(c)
            if c>d:
                print(c)
            else:
                print(d)
main()

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS