有没有办法忽略python列表中的空值?

我正在努力从Google拉日历活动的参与者,并发现当事件没有参与者时,for循环会失败。

            for attendees in event['attendees']:
                attid = event.get('attendees')
                atte = attendees.get('email')
                #print (event['attendees'])
                if attid is "":
                    print ('No Attendees')
                elif atte != None:
                    print(attendees['email'])
评论