LoginSignup
4
4

More than 5 years have passed since last update.

見慣れないif文

Last updated at Posted at 2014-06-12
見慣れないif文
print 'a' if False else 'b'
print 'A' if True else 'B'
出力結果
b
A

なにこの後出し感。。。


追記

これpythonの三項演算子だって
教えてくださった@zetamattaさんに感謝

コメント欄で@tadsanさんに詳しく解説いただいてます。

4
4
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4