Answer the question
In order to leave comments, you need to log in
Where is the correct place to enter an intermediate variable in Python?
There is a task: from the three variables entered, select the smallest one and display it on the screen. There is a piece of code when you run it, enter three numbers 1, 2 and 3, as a result 1 is displayed, run again enter 123, 5 and 9, 1 is displayed. There is a suspicion that I am incorrectly entering an intermediate variable and it does not take values there.
Here is the code itself:
a=int(input())
b=int(input())
c=int(input())
if a<b and a<c:
n=a
if b<a and b<c:
n=b
if c<a and c<b:
n=c
print(n)
Answer the question
In order to leave comments, you need to log in
a=int(input())
b=int(input())
c=int(input())
print(min([a, b, c]))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question