-2
我正在尝试编写一个程序,它接收用户的电子邮件并打印与其关联的URL。到目前为止,我有这样的:使用字符串拼接从电子邮件中提供URL?
def email_intake():
'''Takes email input from the user'''
email = input('Enter your email: ')
if email.find('@'):
return(email)
else:
print('Please enter a valid email address')
email = input('Enter your email: ')
def find_domain(email):
'''Figures out domain name associated with email provided by the user'''
domain = email.split('@')[1]
return (domain)
def url_printer(domain):
'''prints URL associated with the email provided by the user'''
print('The domain of this email address is http//:www. ', domain)
def main():
email = email_intake
domain = find_domain(email)
url_printer(domain)
main()
我知道,我必须做一些字符串拼接找出我的第二个功能,但我不知道在哪里何去何从。我想知道是否有某种方式可以从@角色收集信息给我。如果这是有道理的。谢谢!
到目前为止你有尝试过什么吗? – ptierno 2014-11-06 04:30:37