A = int (("Enter the first digit")
B = int (input ("Enter the second digit"))
C = int (input ("Enter the third digit"))
print("Maximum value is A", A>Band A>C)
print ("Maximum value is B," B>A and B>C)
print ("Maximum value is C," C>Band C>A)
print("Minimum value is A."), not(A>B or A>C))
print ("Minimum value is B."), not (B>A or B>C))
print("Minimum value is C."), not(C>B or C>A))
There are many ways. The way that comes to mind right away is to use it as a conditional sentence, but I'll explain it a little bit because you don't seem to know.
if conditional expression:
What to process
if a > b and a > c:
print ('Maximum value is ', a, ')')
elif b > a and b > c:
print ('Maximum value is ', b, ')')
elif c > a and c > b:
print ('Maximum value is ', c, ')')
But if there are more variables in this way, you have to add more conditional sentences, so I don't use it like this.
print('max:', max(a, b, c))
print('min: ', min(a, b, c)))
So I think it'd be better to use this kind of chords. Python has this function, so look it up and use it~
589 GDB gets version error when attempting to debug with the Presense SDK (IDE)
566 Understanding How to Configure Google API Key
563 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
854 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.