/
20002503.es.001.xlf
89 lines (89 loc) · 11.9 KB
/
20002503.es.001.xlf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="es" datatype="htmlbody" original="https://stackoverflow.com/questions/20002503">
<body>
<group id="20002503">
<trans-unit id="c078b6d076dcefe710d53bf7b6a2d30815819c65" translate="yes" xml:space="preserve">
<source>All of this reasoning also applies to the expression <code>if "Kevin" or "Jon" or "Inbar" == name</code>. the first value, <code>"Kevin"</code>, is true, so the <code>if</code> block executes.</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Todo este razonamiento tambi&eacute;n se aplica a la expresi&oacute;n </font></font> <code>if "Kevin" or "Jon" or "Inbar" == name</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> . </font><font style="vertical-align: inherit;">el primer valor, </font></font> <code>"Kevin"</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> , es verdadero, por lo </font></font> <code>if</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> se ejecuta el bloque </font><font style="vertical-align: inherit;">if</font><font style="vertical-align: inherit;"> .</font></font></target>
</trans-unit>
<trans-unit id="c67b542aaa3db579b395714a4333b3d1435a2025" translate="yes" xml:space="preserve">
<source>And since "Jon" has a positive truth value, the <code>if</code> block executes. That is what causes "Access granted" to be printed regardless of the name given.</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Y como "Jon" tiene un valor de verdad positivo, el </font><font style="vertical-align: inherit;">bloque </font></font> <code>if</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> se ejecuta. </font><font style="vertical-align: inherit;">Eso es lo que hace que se imprima "Acceso otorgado" independientemente del nombre dado.</font></font></target>
</trans-unit>
<trans-unit id="0ad816a28dd6df1cde4f1478cc6639eaafab22a1" translate="yes" xml:space="preserve">
<source>But, inherited from the language C, Python evaluates the logical value of a non zero integer as True.</source>
<target state="translated">Pero,heredado del lenguaje C,Python evalúa el valor lógico de un entero no cero como Verdadero.</target>
</trans-unit>
<trans-unit id="97f5b3661f376e6d87cd88182ac17de6221a77f9" translate="yes" xml:space="preserve">
<source>Compose a sequence of valid values, and use the <code>in</code> operator to test for membership:</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Componga una secuencia de valores v&aacute;lidos y use el </font><font style="vertical-align: inherit;">operador </font></font> <code>in</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> para probar la membres&iacute;a:</font></font></target>
</trans-unit>
<trans-unit id="6cdaaa8cb2e65801aa1c8d80ee153518e1a67b66" translate="yes" xml:space="preserve">
<source>Finally</source>
<target state="translated">Finally</target>
</trans-unit>
<trans-unit id="84a1968bd9f64daefa811481a32c9e9f834182b8" translate="yes" xml:space="preserve">
<source>For safety I'd also suggest you don't hard code passwords.</source>
<target state="translated">Por seguridad,también le sugiero que no codifique las contraseñas.</target>
</trans-unit>
<trans-unit id="80cc6840910af9548af0454b6ad1a3fefe619279" translate="yes" xml:space="preserve">
<source>I am writing a security system that denies access to unauthorized users.</source>
<target state="translated">Estoy escribiendo un sistema de seguridad que niega el acceso a usuarios no autorizados.</target>
</trans-unit>
<trans-unit id="a3cd973ea657fbcb212f90d309b4ce9d4a6cafd9" translate="yes" xml:space="preserve">
<source>In general of the two the second should be preferred as it's easier to read and also faster:</source>
<target state="translated">En general,de los dos,se debería preferir el segundo,ya que es más fácil de leer y también más rápido:</target>
</trans-unit>
<trans-unit id="b275f646f5199bb8cf93a78e76f099e1c8f2d7e7" translate="yes" xml:space="preserve">
<source>In many cases, Python looks and behaves like natural English, but this is one case where that abstraction fails. People can use context clues to determine that "Jon" and "Inbar" are objects joined to the verb "equals", but the Python interpreter is more literal minded.</source>
<target state="translated">En muchos casos,Python se ve y se comporta como el inglés natural,pero este es un caso en el que esa abstracción falla.La gente puede usar pistas de contexto para determinar que "Jon" e "Inbar" son objetos unidos al verbo "equals",pero el intérprete de Python es más literal.</target>
</trans-unit>
<trans-unit id="0aab59b14ef181cdf8e90ef3d531878c23ca8363" translate="yes" xml:space="preserve">
<source>It grants access to authorized users as expected, but it also lets in unauthorized users!</source>
<target state="translated">Concede el acceso a los usuarios autorizados como se esperaba,pero también deja entrar a los usuarios no autorizados!</target>
</trans-unit>
<trans-unit id="88018c8cf855c5a55f54adbb989441649bd6e0d7" translate="yes" xml:space="preserve">
<source>Now, Python builds on that logic and let you use logic literals such as or on integers, and so</source>
<target state="translated">Ahora,Python se basa en esa lógica y te permite usar literales lógicos como o en números enteros,y así</target>
</trans-unit>
<trans-unit id="bd2de340733f018cc1e2caa8e887547674a1d22d" translate="yes" xml:space="preserve">
<source>Simple engineering problem, let's simply it a bit further.</source>
<target state="translated">Un simple problema de ingeniería,vamos un poco más allá.</target>
</trans-unit>
<trans-unit id="858a5277a0f38bc83d1f00178ee33becdcc5b522" translate="yes" xml:space="preserve">
<source>The <code>or</code> operator chooses the first argument with a positive <a href="http://docs.python.org/3/library/stdtypes.html#truth-value-testing">truth value</a>:</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">El </font><font style="vertical-align: inherit;">operador </font></font> <code>or</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> elige el primer argumento con un </font></font><a href="http://docs.python.org/3/library/stdtypes.html#truth-value-testing"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">valor de verdad</font></font></a><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> positivo </font><font style="vertical-align: inherit;">:</font></font></target>
</trans-unit>
<trans-unit id="6fd24aa16b947de5b1ff30e34bb9eb99395e1c08" translate="yes" xml:space="preserve">
<source>The proper way to write it would be:</source>
<target state="translated">La manera apropiada de escribirlo sería:</target>
</trans-unit>
<trans-unit id="a870359ce39fa2fd2375f507d5f49cfc092a3e14" translate="yes" xml:space="preserve">
<source>There are two common ways to properly construct this conditional.</source>
<target state="translated">Hay dos formas comunes de construir adecuadamente este condicional.</target>
</trans-unit>
<trans-unit id="e714298b6e6d3fc3268c09f5f2f86b090462982e" translate="yes" xml:space="preserve">
<source>Use multiple <code>==</code> operators to explicitly check against each value:</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Use m&uacute;ltiples </font><font style="vertical-align: inherit;">operadores </font></font> <code>==</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> para verificar expl&iacute;citamente cada valor:</font></font></target>
</trans-unit>
<trans-unit id="03402a5adafc76cebaa564d872c84bffc5839736" translate="yes" xml:space="preserve">
<source>Which, for user Bob, is equivalent to:</source>
<target state="translated">Lo cual,para el usuario Bob,es equivalente a:</target>
</trans-unit>
<trans-unit id="9518ca47ff668b19cef769e76fd43a5fd00f1455" translate="yes" xml:space="preserve">
<source>Why does `a == b or c or d` always evaluate to True</source>
<target state="translated">¿Por qué `a ==b o c o d` siempre evalúa a Verdadero</target>
</trans-unit>
<trans-unit id="a5099f63193dbcb313bc34d7c6ecbc3ceca3044e" translate="yes" xml:space="preserve">
<source>Why does this occur? I've plainly stated to only grant access when <code>name</code> equals Kevin, Jon, or Inbar. I have also tried the opposite logic, <code>if "Kevin" or "Jon" or "Inbar" == name</code>, but the result is the same.</source>
<target state="translated"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">&iquest;Por qu&eacute; ocurre esto? </font><font style="vertical-align: inherit;">He declarado claramente que solo concede acceso cuando el </font></font> <code>name</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> es igual a Kevin, Jon o Inbar. </font><font style="vertical-align: inherit;">Tambi&eacute;n prob&eacute; la l&oacute;gica opuesta, </font></font> <code>if "Kevin" or "Jon" or "Inbar" == name</code> <font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> , pero el resultado es el mismo.</font></font></target>
</trans-unit>
<trans-unit id="dad95468ab28579c73a9fad7e5ba4c2986a1d96c" translate="yes" xml:space="preserve">
<source>is logically equivalent to:</source>
<target state="translated">es lógicamente equivalente a:</target>
</trans-unit>
</group>
</body>
</file>
</xliff>