我正在尝试在我的模块之间链接信息。在底部,我将有一个摘要模块,它将在订购过程结束时向客户提供订单信息,即...电子邮件地址,地址和从菜单模块订购的物品。但是,我似乎无法弄清楚如何在电子邮件模块和其他模块以及我的摘要模块之间建立链接。当我尝试运行我的主模块时,它告诉我email_address未定义。这是我编程类的最终项目,也是python的新项目。这是电子邮件模块以及摘要模块。
'broadcast'
答案 0 :(得分:0)
只需从电子邮件功能
返回 email_addressimport time
def main():
email_address = email()
summary(email_address)
def email():
email_address = str(input("Please enter a valid email address: "))
email_address_verify = str(input("Please re-enter your email address: "))
if email_address == email_address_verify:
print("Thank you!", "\n")
return email_address
else:
time.sleep(2)
return email()
def summary(email_address):
print(email_address)
main()