简体   繁体   中英

How to save the statement which is given in elif in a variable

How to save the statement which is given in elif in a variable Like:

elif 'date'in calendar:
     Date()

I want to save date word in a variable from elif

date = None

...

elif 'date' in calendar:
    date = Date()

You can just assign it to variable like:

elif 'date' in calendar:
     date = Date()

Before add the remaining if part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM