【发布时间】:2016-11-06 21:36:05
【问题描述】:
我如何编写一个算法来读取三个数字并在 python 中按升序打印出来。请帮助这是我迄今为止尝试过的,希望你们能帮助我,谢谢,这是使用python,我是编程新手。我不知道如何做它所说的升序部分。
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:
print("")*
【问题讨论】:
-
sorted([one, two, three]) -
数字按从小到大排列的顺序称为升序。例如。图5、9、13、17和21按升序排列。 from www.mathsteacher.com.au如果你在上101编程课程,我认为问题与条件有关。您应该检查
if...else语句。 Check this page -
@idjaw 你能解释一下怎么做吗?没看懂
-
@JoseRaulBarreras 我知道这意味着什么,但我不知道如何在 python 中做到这一点
-
你的意思是
if one > two > three:。放下and!
标签: python if-statement iif-function