Compare Three Numbers in Python

You can use the following code to determine the sizes of three numbers:

a = int(input("请输入第一个整数:"))
b = int(input("请输入第二个整数:"))
c = int(input("请输入第三个整数:"))

if a > b and a > c:
    print(f"{a}最大")
elif b > a and b > c:
    print(f"{b}最大")
else:
    print(f"{c}最大")

After the user inputs three integers, the program will compare them and display the largest number.

bannerAds