Super concise conditional statement writing in Python

From , 5 Years ago, written in Python, viewed 95 times.
URL https://pastebin.vip/view/2406a0a9
  1. a=100
  2. b=50
  3. c=a if b is None else b
  4. print(c)
  5. #输出结果为50,这段代码相当于
  6.  
  7. if b is None:
  8.     c = a
  9. else:
  10.     c = b

Reply to "Super concise conditional statement writing in Python"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website