Middle value output code during input integers

Asked 2 years ago, Updated 2 years ago, 14 views

n = list(map(int, input().split()))
n.sort()

print((n[1]))

I got a code to print out the middle of the integer value I entered I don't understand how it works.

python

2022-09-20 10:20

1 Answers

It's not the middle value code .

n = list(map(int, "3 4 5 6 7 8 9".split()))
n.sort()

print((n[1])) #<--- 6 should come out, right? Try "executing code".

You got scammed.


2022-09-20 10:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.