python:if_elif_else

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン両方とも次のリビジョン
python:if_elif_else [2019/06/10 19:01] – [python の三項演算子] ともやんpython:if_elif_else [2019/07/27 04:52] ともやん
行 1: 行 1:
 +<ifauth !@loggedinusers><html>
 +<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
 +<script>
 +     (adsbygoogle = window.adsbygoogle || []).push({
 +          google_ad_client: "ca-pub-0791334967460971",
 +          enable_page_level_ads: true
 +     });
 +</script></html></ifauth>
 ====== if elif else 文 ====== ====== if elif else 文 ======
  
行 15: 行 23:
 ===== if 以上 以下 ===== ===== if 以上 以下 =====
 <code python> <code python>
-if 5 <= val <= 10:+num = int(raw_input()) 
 + 
 +# (5 <= num) and (num <= 10) と同じ 
 +if 5 <= num <= 10: 
 +    print('5 以上 10 以下です。'
 +else 
 +    print('5 未満か 10 より大きいです。')
 </code> </code>
  
  • python/if_elif_else.txt
  • 最終更新: 2019/08/19 06:53
  • by ともやん