
select_demo.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | print() if 3 > 5: print( "Oh! 3 is bigger than 5!" ) elif 4 > 5: print( "Oh! 4 is bigger than 5!" ) elif 5 > 5: print( "Oh! 5 is bigger than 5!" ) elif 6 > 5: print( "Of course! 6 is bigger than 5!" ) else : print( "There is no case :(" ) print() # 檔名: select_demo.py # 作者: Kaiching Chang # 時間: July, 2014 |
select_demo2.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | print() s = 6 if s == 3: print( "3..." ) elif s == 4: print( "4..." ) elif s == 5: print( "5..." ) elif s == 6: print( "6..." ) else : print( "There is no case :(" ) print() # 檔名: select_demo2.py # 作者: Kaiching Chang # 時間: July, 2014 |
exercise0601.py
1 2 3 4 5 6 7 8 9 10 | a = 3 b = 5 if a == b: print( "a == b" ) else : print( "a != b" ) # 檔名: exercise0601.py # 作者: Kaiching Chang # 時間: July, 2014 |
exercise0602.py
1 2 3 4 5 6 7 8 9 10 | a = int (input( "a: " )) b = int (input( "b: " )) if a == b: print( "a == b" ) else : print( "a != b" ) # 檔名: exercise0602.py # 作者: Kaiching Chang # 時間: July, 2014 |
exercise0603.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | g = int (input( "g: " )) if g < 60: print( "Bad!" ) elif 60 <= g < 70: print( "Not Bad" ) elif 70 <= g < 80: print( "Good!" ) elif 80 <= g < 90: print( "Great!" ) elif 90 <= g < 100: print( "Excellent!" ) elif g == 100: print( "Perfect!" ) else : print( "Pardon?" ) # 檔名: exercise0603.py # 作者: Kaiching Chang # 時間: July, 2014 |
the end

沒有留言:
張貼留言