[英]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 中给出的语句保存在变量中,例如:
elif 'date'in calendar:
Date()
I want to save date word in a variable from elif我想将日期字保存在 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.在添加剩余的 if 部分之前。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.