1. 程式人生 > >【Python練習題】程序5

【Python練習題】程序5

python練習 style none spa pla AS 輸出 put audio


#題目:輸入三個整數x,y,z,請把這三個數由小到大輸出。

#
a = input(‘請輸入整數: \n‘) # # b = input(‘請輸入整數: \n‘) # # c = input(‘請輸入整數: \n‘) # # l = [a,b,c] # # l.sort() # # for i in l: # print (i) 方法2: l = [] for i in range(3): i = input(請輸入數字:\n) l.append(i) l.sort() print(l)

要多用列表方式來表達可以一次性做的事。

【Python練習題】程序5