Advertisement
here2share

# else_for_list_comprehension.py

Sep 8th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.10 KB | None | 0 0
  1. # else_for_list_comprehension.py
  2.  
  3. print [a if a!=0 else '$$$' for a in [123,'abc',0,'xyz',0,'gold']]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement