Which method to check if string index is queal to character.

Chris Angelico rosuav at gmail.com
Mon Dec 28 14:23:31 EST 2020


On Tue, Dec 29, 2020 at 6:18 AM Bischoop <Bischoop at vimart.net> wrote:
>
> On 2020-12-28, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> >
> >   "@" in s
> >
>
> That's what I thought.
>
> >>I want check if string is a valid email address.
> >
> >   I suggest to first try and define "valid email address" in English.
> >
> >
>
> A valid email address consists of an email prefix and an email domain,
> both in acceptable formats. The prefix appears to the left of the @ symbol.
> The domain appears to the right of the @ symbol.
> For example, in the address example at mail.com, "example" is the email prefix,
> and "mail.com" is the email domain.
>

To see if it's a valid email address, send email to it and get the
person to verify receipt. Beyond that, all you can really check is
that it has an at sign in it (since a local address isn't usually
useful in contexts where you'd want to check).

So the check you are already looking at is sufficient.

ChrisA


More information about the Python-list mailing list