# <h1>松林Java05(Python)筆記2019/11/27 a.print ![](https://i.imgur.com/7n2xA1T.png) b.格式化輸出 ![](https://i.imgur.com/ypy22Yl.png) c.格式化輸入 ![](https://i.imgur.com/ESMFFVv.png) print("成績輸入系統") id=int(input("請輸入學號: ")) eng=int(input("請輸入英文成績: ")) math=int(input("請輸入數學成績: ")) ave=(eng+math)/2 print("平均分數: %.2f"%ave) <hr> d.排序 if else ![](https://i.imgur.com/I5gi3yO.png) x=int(input("please enter x: ")) y=int(input("please enter y: ")) z=int(input("please enter z: ")) if(x>y): if(x>z): print("x is the biggest") if(y>z): print("y is middle z is the smallest") else: print("z is middle y is the smallest") else: print("z is the biggest") print("x is middle y is the smallest") else: if(y>z): print("y is the biggest") if(x>z): print("x is middle z is the smallest") else: print("z is middle x is the smallest") else: print("z is the biggest") print("y is middle x is the smallest") <hr> e.串列 list 串列可以有整數,浮點數,字串,tuple元組,list串列切片 list串列[] tuple元組() dict字典{:} 集合{,} list_name[:]切片全部 list_name[:n]從1到n list_name[n:]從n到最後 list_name[n:n]從n到n list_name[開始:結束::間隔值] index 0~5(正向) or -1~-6(逆向) ![](https://i.imgur.com/48mj4dN.png)