6.基本程序結構

1.條件結構

def main():
	temperature = float(input('please input the temperature :'))
	if temperature > 50 :
		print('High')
	else:
		print('Low')
	if temperature > 50 and temperature < 100:
		print('1')

2.異常處理

try:
	<body>
except <ErrorType>:
	<handler>

3.循環結構

@ for循環
for i in range(n):

@ while循環
while <condition>:
	<body>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章