Respuesta a: Ayuda con una duda en ejer 3 del video 16

#21247

Javi
Participante

<div style=»color: #839496; background-color: #002b36; font-family: Consolas, ‘Courier New’, monospace; line-height: 22px; white-space: pre;»>
<div><span style=»color: #93a1a1; font-weight: bold;»>def</span> <span style=»color: #268bd2;»>email_valid</span>(email):</div>
<div>    <span style=»color: #859900;»>if</span> <span style=»color: #2aa198;»>’@'</span> <span style=»color: #859900;»>in</span> email <span style=»color: #859900;»>and</span> <span style=»color: #2aa198;»>’.'</span> <span style=»color: #859900;»>in</span> email:</div>
<div>        <span style=»color: #859900;»>if</span> <span style=»color: #2aa198;»>’@'</span> <span style=»color: #859900;»>!=</span> email[<span style=»color: #d33682;»>0</span>] <span style=»color: #859900;»>and</span> <span style=»color: #2aa198;»>’.'</span> <span style=»color: #859900;»>!=</span> email[<span style=»color: #268bd2;»>len</span>(email)<span style=»color: #859900;»>-</span><span style=»color: #d33682;»>1</span>] <span style=»color: #859900;»>and</span> email.index(<span style=»color: #2aa198;»>’@'</span>)<span style=»color: #859900;»>+</span><span style=»color: #d33682;»>1</span> <span style=»color: #859900;»>!=</span> email.index(<span style=»color: #2aa198;»>’.'</span>):</div>
<div>            <span style=»color: #859900;»>return</span> <span style=»color: #b58900;»>True</span></div>
<div>        <span style=»color: #859900;»>else</span>:</div>
<div>            <span style=»color: #859900;»>return</span> <span style=»color: #b58900;»>False</span></div>
<div>    <span style=»color: #859900;»>else</span>:</div>
<div>        <span style=»color: #859900;»>return</span> <span style=»color: #b58900;»>False</span></div>
</div>