あなたは)(ソート使用することができますが、最初にあなたが持っているこれにしようと、リスト内の番号を保存します。
nums = []
one = nums.append(float(input("Please input a number : ")))
two = nums.append(float(input("Please input a second number : ")))
three = nums.append(float(input("Please input a third number : ")))
for num in sorted(nums):
print (num)
sorted() - Python Doc
ifとelse文を使用する必要がある場合は、すべての組み合わせで入力番号について考えて、これを評価する必要があります。
one = float(input("Please input a number : "))
two = float(input("Please input a second number : "))
three = float(input("Please input a third number : "))
if one < two and three < two:
if one > three:
print(three, one, two)
else:
print(one, three, two)
elif one < three and two < three:
if one > two:
print(two, one, three)
else:
print(one, two, three)
elif two < one and three < one:
if three > two:
print(two, three, one)
else:
print(three, two, one)
else:
print(one, two, three)
出典
2016-11-06 21:50:48
kip
'sorted([one、two、three]) ' – idjaw
数字は小さい順に並べると昇順になると言われます。例えば。図5、図9、図13、図17、および図21は、昇順に配置されている。 [from www.mathsteacher.com.au](http://www.mathsteacher.com.au/year7/ch02_power/06_asc/asc.htm) 101のプログラミングコースに参加している場合は、問題は条件付き。 'if ... else'ステートメントをチェックする必要があります。 [このページを確認](http://www.openbookproject.net/books/bpp4awd/ch04.html) –
@idjawあなたはそれを行う方法を説明できますか?私はそれを理解していません – david