How do I use line breaking in the answer?

Asked

Viewed 26 times

0

n1 = int(input())
n2 = int(input())
n3 = int(input())
n0 = (n1, n2, n3)
print(sorted(n0))

I wanted the answer to come out in each different line, that is, one below the other.

1 answer

1


You can capture the values and then implement a repeat loop to display the result.

The code would stand:

n1 = int(input())
n2 = int(input())
n3 = int(input())
n0 = sorted((n1, n2, n3))
for c in n0:
    print(c)
print()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.