📜  如何在python代码示例中设置条件键

📅  最后修改于: 2022-03-11 14:46:30.640000             🧑  作者: Mango

代码示例1
apple = 'green'
orange = None
params = urllib.urlencode({
    'apple': apple,
    **({ 'orange': orange } if orange else {})
})