ホームページ >バックエンド開発 >Python チュートリアル >Pythonの条件判断とループ
score = 75 if score >= 60: print 'passed'
score = 55 if score >= 60: print 'passed' else: print 'failed'
score = 85 if score >= 90: print 'excellent' elif score >= 80: print 'good' elif score >= 60: print 'passed' else: print 'failed'
L = [75, 92, 59, 68] sum = 0.0 for x in L: sum = sum + x print sum / 4
sum = 0 x = 1 while x < 100: sum = sum + x x = x + 2 print sum