-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathintroduction.po
More file actions
836 lines (751 loc) · 35.9 KB
/
introduction.po
File metadata and controls
836 lines (751 loc) · 35.9 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 1990-2020, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Python 2.7\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-09 18:46+0900\n"
"PO-Revision-Date: 2019-09-01 05:18+0000\n"
"Last-Translator: Adorilson Bezerra <adorilson@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/python-doc/"
"python-27/language/pt_BR/)\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../../tutorial/introduction.rst:5
msgid "An Informal Introduction to Python"
msgstr "Uma introdução informal ao Python"
#: ../../tutorial/introduction.rst:7
msgid ""
"In the following examples, input and output are distinguished by the "
"presence or absence of prompts (:term:`>>>` and :term:`...`): to repeat the "
"example, you must type everything after the prompt, when the prompt appears; "
"lines that do not begin with a prompt are output from the interpreter. Note "
"that a secondary prompt on a line by itself in an example means you must "
"type a blank line; this is used to end a multi-line command."
msgstr ""
"Nos exemplos seguintes, pode-se distinguir a entrada da saída pela presença "
"ou\n"
"ausência dos prompts (``>>>`` e ``...``): para repetir o exemplo, você deve\n"
"digitar tudo após o prompt, quando o mesmo aparece; linhas que não "
"começarem\n"
"com um prompt são na verdade as saídas geradas pelo interpretador. Observe "
"que\n"
"quando aparece uma linha contendo apenas o prompt secundário ``...`` você\n"
"deve digitar uma linha em branco; é assim que se encerra um comando de\n"
"múltiplas linhas."
#: ../../tutorial/introduction.rst:14
msgid ""
"Many of the examples in this manual, even those entered at the interactive "
"prompt, include comments. Comments in Python start with the hash character, "
"``#``, and extend to the end of the physical line. A comment may appear at "
"the start of a line or following whitespace or code, but not within a string "
"literal. A hash character within a string literal is just a hash character. "
"Since comments are to clarify code and are not interpreted by Python, they "
"may be omitted when typing in examples."
msgstr ""
"Muitos dos exemplos neste manual, até mesmo aqueles digitados "
"interativamente,\n"
"incluem comentários. Comentários em Python são iniciados pelo caractere "
"``#``,\n"
"e se estendem até o final da linha física. Um comentário pode aparecer no\n"
"início da linha, depois de um espaço em branco ou código, mas nunca dentro "
"de\n"
"uma string literal. O caractere ``#`` em uma string literal não passa de um\n"
"caractere ``#``. Uma vez que os comentários são usados apenas para explicar "
"o\n"
"código e não são interpretados pelo Python, eles podem ser omitidos ao "
"digitar\n"
"os exemplos."
#: ../../tutorial/introduction.rst:22
msgid "Some examples::"
msgstr "Alguns exemplos::"
#: ../../tutorial/introduction.rst:33
msgid "Using Python as a Calculator"
msgstr "Usando Python como uma Calculadora"
#: ../../tutorial/introduction.rst:35
msgid ""
"Let's try some simple Python commands. Start the interpreter and wait for "
"the primary prompt, ``>>>``. (It shouldn't take long.)"
msgstr ""
"Vamos experimentar alguns comandos simples em Python. Inicie o interpretador "
"e\n"
"aguarde o prompt primário, ``>>>``. (Não deve demorar muito.)"
#: ../../tutorial/introduction.rst:42
msgid "Numbers"
msgstr "Números"
#: ../../tutorial/introduction.rst:44
msgid ""
"The interpreter acts as a simple calculator: you can type an expression at "
"it and it will write the value. Expression syntax is straightforward: the "
"operators ``+``, ``-``, ``*`` and ``/`` work just like in most other "
"languages (for example, Pascal or C); parentheses (``()``) can be used for "
"grouping. For example::"
msgstr ""
"O interpretador funciona como uma calculadora bem simples: você pode "
"digitar\n"
"uma expressão e o resultado será apresentado. A sintaxe de expressões é a\n"
"usual: operadores ``+``, ``-``, ``*`` e ``/`` funcionam da mesma forma que "
"em\n"
"outras linguagens tradicionais (por exemplo, Pascal ou C); parênteses podem\n"
"ser usados para agrupar expressões. Por exemplo::"
#: ../../tutorial/introduction.rst:59
msgid ""
"The integer numbers (e.g. ``2``, ``4``, ``20``) have type :class:`int`, the "
"ones with a fractional part (e.g. ``5.0``, ``1.6``) have type :class:"
"`float`. We will see more about numeric types later in the tutorial."
msgstr ""
"Os números inteiros (ex. ``2``, ``4``, ``20``) são do tipo :class:`int`, "
"aqueles com parte fracional (ex. ``5.0``, ``1.6``) são do tipo :class:"
"`float`. Veremos mais sobre tipos numéricos posteriormente neste tutorial."
#: ../../tutorial/introduction.rst:63
msgid ""
"The return type of a division (``/``) operation depends on its operands. If "
"both operands are of type :class:`int`, :term:`floor division` is performed "
"and an :class:`int` is returned. If either operand is a :class:`float`, "
"classic division is performed and a :class:`float` is returned. The ``//`` "
"operator is also provided for doing floor division no matter what the "
"operands are. The remainder can be calculated with the ``%`` operator::"
msgstr ""
#: ../../tutorial/introduction.rst:81
msgid ""
"With Python, it is possible to use the ``**`` operator to calculate powers "
"[#]_::"
msgstr ""
"Com Python, podemos usar o operador ``**`` para calcular potências [#]_::"
#: ../../tutorial/introduction.rst:88
msgid ""
"The equal sign (``=``) is used to assign a value to a variable. Afterwards, "
"no result is displayed before the next interactive prompt::"
msgstr ""
"O sinal de igual (``'='``) é usado para atribuir um valor a uma variável.\n"
"Depois de uma atribuição, nenhum resultado é exibido antes do próximo "
"prompt::"
#: ../../tutorial/introduction.rst:96
msgid ""
"If a variable is not \"defined\" (assigned a value), trying to use it will "
"give you an error::"
msgstr ""
"Se uma variável não é \"definida\" (não tem um valor atribuído), tentar "
"utiliza-la gerará um erro::"
#: ../../tutorial/introduction.rst:104
msgid ""
"There is full support for floating point; operators with mixed type operands "
"convert the integer operand to floating point::"
msgstr ""
"Há suporte completo para ponto flutuante (*float*); operadores com "
"operandos\n"
"de diferentes tipos convertem o inteiro para ponto flutuante:"
#: ../../tutorial/introduction.rst:112
msgid ""
"In interactive mode, the last printed expression is assigned to the variable "
"``_``. This means that when you are using Python as a desk calculator, it "
"is somewhat easier to continue calculations, for example::"
msgstr ""
"No modo interativo, o valor da última expressão exibida é atribuída a "
"variável\n"
"``_``. Assim, ao utilizar Python como uma calculadora, fica mais fácil\n"
"prosseguir com os cálculos, por exemplo::"
#: ../../tutorial/introduction.rst:125
msgid ""
"This variable should be treated as read-only by the user. Don't explicitly "
"assign a value to it --- you would create an independent local variable with "
"the same name masking the built-in variable with its magic behavior."
msgstr ""
"Essa variável especial deve ser tratada como *somente para leitura* pelo\n"
"usuário. Nunca lhe atribua explicitamente um valor --- do contrário, "
"estaria\n"
"criando uma outra variável (homônima) independente, que mascararia a "
"variável\n"
"especial com seu comportamento mágico."
#: ../../tutorial/introduction.rst:129
msgid ""
"In addition to :class:`int` and :class:`float`, Python supports other types "
"of numbers, such as :class:`~decimal.Decimal` and :class:`~fractions."
"Fraction`. Python also has built-in support for :ref:`complex numbers "
"<typesnumeric>`, and uses the ``j`` or ``J`` suffix to indicate the "
"imaginary part (e.g. ``3+5j``)."
msgstr ""
"Além de :class:`int` e :class:`float`, o Python suporta outros tipos de "
"números, tais como :class:`~decimal.Decimal` e :class:`~fractions.Fraction`. "
"O Python também possui suporte incorporado a :ref:`complex numbers 1`, "
"``j`` ou ``J`` para indicar a parte imaginária (por exemplo, ``3+5j``). "
#: ../../tutorial/introduction.rst:139
msgid "Strings"
msgstr "Strings"
#: ../../tutorial/introduction.rst:141
msgid ""
"Besides numbers, Python can also manipulate strings, which can be expressed "
"in several ways. They can be enclosed in single quotes (``'...'``) or "
"double quotes (``\"...\"``) with the same result [#]_. ``\\`` can be used "
"to escape quotes::"
msgstr ""
"Além de números, Python também pode manipular strings (sequências de\n"
"caracteres), que podem ser expressas de diversas formas. Elas podem ser\n"
"delimitadas por aspas simples ou duplas::"
#: ../../tutorial/introduction.rst:159
msgid ""
"In the interactive interpreter, the output string is enclosed in quotes and "
"special characters are escaped with backslashes. While this might sometimes "
"look different from the input (the enclosing quotes could change), the two "
"strings are equivalent. The string is enclosed in double quotes if the "
"string contains a single quote and no double quotes, otherwise it is "
"enclosed in single quotes. The :keyword:`print` statement produces a more "
"readable output, by omitting the enclosing quotes and by printing escaped "
"and special characters::"
msgstr ""
"O interpretador exibe o resultado de operações com strings da mesma forma "
"como\n"
"elas são digitadas na entrada: dentro de aspas, e com aspas, caracteres\n"
"acentuados e outros caracteres especiais representados por sequências de\n"
"escape com barras invertidas (como ``'\\t'``, ``'\\xc3\\xa9'`` etc.), para\n"
"mostrar o valor preciso. A string é delimitada entre aspas simples, exceto\n"
"quando ela contém uma aspa simples e nenhuma aspa dupla. O comando\n"
":keyword:`print` produz uma saída mais legível para tais strings com\n"
"caracteres especiais."
#: ../../tutorial/introduction.rst:179
msgid ""
"If you don't want characters prefaced by ``\\`` to be interpreted as special "
"characters, you can use *raw strings* by adding an ``r`` before the first "
"quote::"
msgstr ""
"Se não quiseres que os caracteres sejam precedidos por ``\\`` para serem "
"interpretados como caracteres especiais, poderás usar *raw strings* "
"adicionando um ``r`` antes da primeira citação ::"
#: ../../tutorial/introduction.rst:189
msgid ""
"String literals can span multiple lines. One way is using triple-quotes: "
"``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically "
"included in the string, but it's possible to prevent this by adding a ``\\`` "
"at the end of the line. The following example::"
msgstr ""
"As Strings literais podem abranger várias linhas. Uma maneira é usar as "
"aspas triplas: ``\"\"\"...\"\"\"`` or ``'''...'''``. O fim das linhas é "
"incluído automaticamente na String, mas é possível evitar isso adicionando "
"uma ``\\`` no final. O seguinte exemplo::"
#: ../../tutorial/introduction.rst:200
msgid ""
"produces the following output (note that the initial newline is not "
"included):"
msgstr ""
"produz a seguinte saída (observe que a linha inicial não está incluída):"
#: ../../tutorial/introduction.rst:208
msgid ""
"Strings can be concatenated (glued together) with the ``+`` operator, and "
"repeated with ``*``::"
msgstr ""
"Strings podem ser concatenadas (coladas) com o operador ``+``, e repetidas "
"com ``*``::"
#: ../../tutorial/introduction.rst:215
msgid ""
"Two or more *string literals* (i.e. the ones enclosed between quotes) next "
"to each other are automatically concatenated. ::"
msgstr ""
"Dois ou mais *literais String* (ou seja, entre aspas) ao lado do outro são "
"automaticamente concatenados."
#: ../../tutorial/introduction.rst:221
msgid ""
"This feature is particularly useful when you want to break long strings::"
msgstr ""
"Esse recurso é particularmente útil quando você quer quebrar Strings longas::"
#: ../../tutorial/introduction.rst:228
msgid ""
"This only works with two literals though, not with variables or expressions::"
msgstr "Isso só funciona com dois literais, não com variáveis ou expressões::"
#: ../../tutorial/introduction.rst:238
msgid ""
"If you want to concatenate variables or a variable and a literal, use ``+``::"
msgstr ""
"Se você quiser concatenar variáveis ou uma variável e um literal, use ``+``::"
#: ../../tutorial/introduction.rst:243
msgid ""
"Strings can be *indexed* (subscripted), with the first character having "
"index 0. There is no separate character type; a character is simply a string "
"of size one::"
msgstr ""
"As Strings podem ser *indexadas* (subscritas), com o primeiro caractere como "
"índice 0. Não há nenhum tipo de caractere separado; um caractere é "
"simplesmente uma String cujo tamanho é 1::"
#: ../../tutorial/introduction.rst:253
msgid ""
"Indices may also be negative numbers, to start counting from the right::"
msgstr ""
"Índices também pode ser números negativos para inicar contagens pela "
"direita::"
#: ../../tutorial/introduction.rst:262
msgid "Note that since -0 is the same as 0, negative indices start from -1."
msgstr "Note que dado que -0 é o mesmo que 0, índices negativos começam em -1."
#: ../../tutorial/introduction.rst:264
msgid ""
"In addition to indexing, *slicing* is also supported. While indexing is "
"used to obtain individual characters, *slicing* allows you to obtain a "
"substring::"
msgstr ""
"Além da indexação, o *fatiamento* também é permitido. Embora a indexação "
"seja usada para obter caracteres individuais, *fatiar* permite que você "
"obtenha uma substring::"
#: ../../tutorial/introduction.rst:272
msgid ""
"Note how the start is always included, and the end always excluded. This "
"makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::"
msgstr ""
"Observe como o início sempre está incluído, e o fim sempre é excluído. Isso "
"garante que ``s[:i] + s[i:]`` seja sempre igual a ``s``::"
#: ../../tutorial/introduction.rst:280
msgid ""
"Slice indices have useful defaults; an omitted first index defaults to zero, "
"an omitted second index defaults to the size of the string being sliced. ::"
msgstr ""
"Os índices do fatiamento possui padrões úteis; um primeiro índice omitido "
"padrão é zero, um segundo índice omitido por padrão para o tamanho da "
"seqüência sendo cortada::"
#: ../../tutorial/introduction.rst:290
msgid ""
"One way to remember how slices work is to think of the indices as pointing "
"*between* characters, with the left edge of the first character numbered 0. "
"Then the right edge of the last character of a string of *n* characters has "
"index *n*, for example::"
msgstr ""
"Uma maneira de lembrar como slices funcionam é pensar que os índices "
"indicam\n"
"posições *entre* caracteres, onde a borda esquerda do primeiro caractere é "
"0.\n"
"Assim, a borda direita do último caractere de uma string de comprimento *n*\n"
"tem índice *n*, por exemplo::"
#: ../../tutorial/introduction.rst:301
msgid ""
"The first row of numbers gives the position of the indices 0...6 in the "
"string; the second row gives the corresponding negative indices. The slice "
"from *i* to *j* consists of all characters between the edges labeled *i* and "
"*j*, respectively."
msgstr ""
"A primeira fileira de números indica a posição dos índices 0...6 na string; "
"a\n"
"segunda fileira indica a posição dos respectivos índices negativos. Uma "
"fatia\n"
"de *i* a *j* consiste em todos os caracteres entre as bordas *i* e *j*,\n"
"respectivamente."
#: ../../tutorial/introduction.rst:306
msgid ""
"For non-negative indices, the length of a slice is the difference of the "
"indices, if both are within bounds. For example, the length of "
"``word[1:3]`` is 2."
msgstr ""
"Para índices positivos, o comprimento da fatia é a diferença entre os "
"índices,\n"
"se ambos estão dentro dos limites da string. Por exemplo, comprimento de\n"
"``palavra[1:3]`` é 2."
#: ../../tutorial/introduction.rst:310
msgid "Attempting to use an index that is too large will result in an error::"
msgstr ""
"A tentativa de usar um índice que seja muito grande resultará em um erro::"
#: ../../tutorial/introduction.rst:317
msgid ""
"However, out of range slice indexes are handled gracefully when used for "
"slicing::"
msgstr ""
"No entanto, os índices de fatiamento fora do alcance são tratados com "
"graciosamente quando usados para fatiamento::"
#: ../../tutorial/introduction.rst:325
msgid ""
"Python strings cannot be changed --- they are :term:`immutable`. Therefore, "
"assigning to an indexed position in the string results in an error::"
msgstr ""
"As Srings do Python não podem ser alteradas --- são :term:`imutáveis`. "
"Portanto, atribuir a uma posição indexada na seqüência resulta em um erro::"
#: ../../tutorial/introduction.rst:335
msgid "If you need a different string, you should create a new one::"
msgstr "Se você precisar de uma String diferente, precisarás criar uma nova::"
#: ../../tutorial/introduction.rst:342
msgid "The built-in function :func:`len` returns the length of a string::"
msgstr ""
"A função built-in (embutida) :func:`len` devolve o comprimento de uma "
"string::"
#: ../../tutorial/introduction.rst:354
msgid ":ref:`typesseq`"
msgstr ":ref:`typesseq`"
#: ../../tutorial/introduction.rst:352
msgid ""
"Strings, and the Unicode strings described in the next section, are examples "
"of *sequence types*, and support the common operations supported by such "
"types."
msgstr ""
" Strings, e as strings Unicode descritas na próxima seção, são exemplos\n"
" de *sequências* e implementam as operações comuns associadas com esses\n"
" objetos."
#: ../../tutorial/introduction.rst:358
msgid ":ref:`string-methods`"
msgstr ":ref:`string-methods`"
#: ../../tutorial/introduction.rst:357
msgid ""
"Both strings and Unicode strings support a large number of methods for basic "
"transformations and searching."
msgstr ""
" Tanto strings comuns quanto Unicode oferecem um grande número de métodos\n"
" para busca e transformações básicas."
#: ../../tutorial/introduction.rst:361
msgid ":ref:`formatstrings`"
msgstr ":ref:`formatstrings`"
#: ../../tutorial/introduction.rst:361
msgid "Information about string formatting with :meth:`str.format`."
msgstr ""
"Informações sobre formatação de String com o método :meth:`str.format`."
#: ../../tutorial/introduction.rst:364
msgid ":ref:`string-formatting`"
msgstr ":ref:`string-formatting`"
#: ../../tutorial/introduction.rst:364
msgid ""
"The old formatting operations invoked when strings and Unicode strings are "
"the left operand of the ``%`` operator are described in more detail here."
msgstr ""
" As operações de formatação de strings antigas, que acontecem quando\n"
" strings simples e Unicode aparecem à direita do operador ``%`` são\n"
" descritas dom mais detalhes nesta seção."
#: ../../tutorial/introduction.rst:371
msgid "Unicode Strings"
msgstr "Strings Unicode"
#: ../../tutorial/introduction.rst:376
msgid ""
"Starting with Python 2.0 a new data type for storing text data is available "
"to the programmer: the Unicode object. It can be used to store and "
"manipulate Unicode data (see http://www.unicode.org/) and integrates well "
"with the existing string objects, providing auto-conversions where necessary."
msgstr ""
"A partir de Python 2.0 um novo tipo para armazenar textos foi introduzido: "
"o\n"
"tipo ``unicode``. Ele pode ser usado para armazenar e manipular dados no\n"
"padrão Unicode (veja http://www.unicode.org/) e se integra bem aos objetos\n"
"string pré-existentes, realizando conversões automáticas quando necessário."
#: ../../tutorial/introduction.rst:381
msgid ""
"Unicode has the advantage of providing one ordinal for every character in "
"every script used in modern and ancient texts. Previously, there were only "
"256 possible ordinals for script characters. Texts were typically bound to a "
"code page which mapped the ordinals to script characters. This lead to very "
"much confusion especially with respect to internationalization (usually "
"written as ``i18n`` --- ``'i'`` + 18 characters + ``'n'``) of software. "
"Unicode solves these problems by defining one code page for all scripts."
msgstr ""
"Unicode tem a vantagem de associar um único número ordinal a cada "
"caractere,\n"
"para todas as formas de escrita usadas em textos modernos ou antigos.\n"
"Anteriormente, havia somente 256 números ordinais possíveis para "
"identificar\n"
"caracteres. Cada texto era tipicamente limitado a uma \"code page\" (uma "
"tabela\n"
"de códigos) que associava ordinais aos caracteres. Isso levou a muita "
"confusão\n"
"especialmente no âmbito da internacionalização de software (comumente "
"escrito\n"
"como ``i18n`` porque ``internationalization`` é ``'i'`` + 18 letras +\n"
"``'n'``). Unicode resolve esses problemas ao definir uma única tabela de\n"
"códigos para todos os conjuntos de caracteres."
#: ../../tutorial/introduction.rst:389
msgid ""
"Creating Unicode strings in Python is just as simple as creating normal "
"strings::"
msgstr ""
"Criar strings Unicode em Python é tão simples quanto criar strings normais::"
#: ../../tutorial/introduction.rst:395
msgid ""
"The small ``'u'`` in front of the quote indicates that a Unicode string is "
"supposed to be created. If you want to include special characters in the "
"string, you can do so by using the Python *Unicode-Escape* encoding. The "
"following example shows how::"
msgstr ""
"O ``u`` antes das aspas indica a criação de uma string Unicode. Se você\n"
"desejar incluir caracteres especiais na string, você pode fazê-lo através "
"da\n"
"codificação *Unicode-Escape* de Python. O exemplo a seguir mostra como::"
#: ../../tutorial/introduction.rst:403
msgid ""
"The escape sequence ``\\u0020`` indicates to insert the Unicode character "
"with the ordinal value 0x0020 (the space character) at the given position."
msgstr ""
"O código de escape ``\\u0020`` insere um caractere Unicode com valor "
"ordinal\n"
"0x0020 (o espaço em branco) naquela posição."
#: ../../tutorial/introduction.rst:406
msgid ""
"Other characters are interpreted by using their respective ordinal values "
"directly as Unicode ordinals. If you have literal strings in the standard "
"Latin-1 encoding that is used in many Western countries, you will find it "
"convenient that the lower 256 characters of Unicode are the same as the 256 "
"characters of Latin-1."
msgstr ""
"Os outros caracteres são interpretados usando seus valores ordinais como\n"
"valores ordinais em Unicode. Se você possui strings literais na codificação\n"
"padrão Latin-1 que é usada na maioria dos países ocidentais, achará\n"
"conveniente que os 256 caracteres inferiores do Unicode coincidem com os "
"256\n"
"caracteres do Latin-1."
#: ../../tutorial/introduction.rst:412
msgid ""
"For experts, there is also a raw mode just like the one for normal strings. "
"You have to prefix the opening quote with 'ur' to have Python use the *Raw-"
"Unicode-Escape* encoding. It will only apply the above ``\\uXXXX`` "
"conversion if there is an uneven number of backslashes in front of the small "
"'u'. ::"
msgstr ""
"Para os experts, existe ainda um modo *raw* da mesma forma que existe para\n"
"strings normais. Basta prefixar a string com 'ur' para usar a codificação\n"
"*Raw-Unicode-Escape*. A conversão ``\\uXXXX`` descrita acima será aplicada\n"
"somente se houver um número ímpar de barras invertidas antes do escape 'u'.\n"
"::"
#: ../../tutorial/introduction.rst:423
msgid ""
"The raw mode is most useful when you have to enter lots of backslashes, as "
"can be necessary in regular expressions."
msgstr ""
"O modo raw (cru) é muito útil para evitar o excesso de barras invertidas, "
"por\n"
"exemplo, em expressões regulares."
#: ../../tutorial/introduction.rst:426
msgid ""
"Apart from these standard encodings, Python provides a whole set of other "
"ways of creating Unicode strings on the basis of a known encoding."
msgstr ""
"Além dessas codificações padrão, Python oferece todo um conjunto de "
"maneiras\n"
"de se criar strings Unicode a partir de alguma codificação conhecida."
#: ../../tutorial/introduction.rst:431
msgid ""
"The built-in function :func:`unicode` provides access to all registered "
"Unicode codecs (COders and DECoders). Some of the more well known encodings "
"which these codecs can convert are *Latin-1*, *ASCII*, *UTF-8*, and "
"*UTF-16*. The latter two are variable-length encodings that store each "
"Unicode character in one or more bytes. The default encoding is normally set "
"to ASCII, which passes through characters in the range 0 to 127 and rejects "
"any other characters with an error. When a Unicode string is printed, "
"written to a file, or converted with :func:`str`, conversion takes place "
"using this default encoding. ::"
msgstr ""
"A função embutida :func:`unicode` dá acesso a todos os codecs Unicode\n"
"registrados (COders e DECoders). Alguns dos codecs mais conhecidos são:\n"
"*Latin-1*, *ASCII*, *UTF-8*, e *UTF-16*. Os dois últimos são codificações "
"de\n"
"tamanho variável para armazenar cada caractere Unicode em um ou mais bytes.\n"
"(N.d.T: no Brasil, é muito útil o codec *cp1252*, variante estendida do\n"
"*Latin-1* usada na maioria das versões do MS Windows distribuídas no país,\n"
"contendo caracteres comuns em textos, como aspas assimétricas ``“x”`` e\n"
"``‘y’``, travessão ``—``, bullet ``•`` etc.)."
#: ../../tutorial/introduction.rst:451
msgid ""
"To convert a Unicode string into an 8-bit string using a specific encoding, "
"Unicode objects provide an :func:`encode` method that takes one argument, "
"the name of the encoding. Lowercase names for encodings are preferred. ::"
msgstr ""
"Para converter uma string Unicode em uma string de 8-bits usando uma\n"
"codificação específica, basta invocar o método :func:`encode` de objetos\n"
"Unicode passando como parâmetro o nome da codificação destino. É preferível\n"
"escrever nomes de codificação em letras minúsculas. ::"
#: ../../tutorial/introduction.rst:458
msgid ""
"If you have data in a specific encoding and want to produce a corresponding "
"Unicode string from it, you can use the :func:`unicode` function with the "
"encoding name as the second argument. ::"
msgstr ""
"Se você tem um texto em uma codificação específica, e deseja produzir uma\n"
"string Unicode a partir dele, pode usar a função :func:`unicode`, passando "
"o\n"
"nome da codificação de origem como segundo argumento. ::"
#: ../../tutorial/introduction.rst:469
msgid "Lists"
msgstr "Listas"
#: ../../tutorial/introduction.rst:471
msgid ""
"Python knows a number of *compound* data types, used to group together other "
"values. The most versatile is the *list*, which can be written as a list of "
"comma-separated values (items) between square brackets. Lists might contain "
"items of different types, but usually the items all have the same type. ::"
msgstr ""
"Python inclui diversas estruturas de dados *compostas*, usadas para agrupar\n"
"outros valores. A mais versátil é *list* (lista), que pode ser escrita como\n"
"uma lista de valores (itens) separados por vírgula, entre colchetes. Os\n"
"valores contidos na lista não precisam ser todos do mesmo tipo. ::"
#: ../../tutorial/introduction.rst:480
msgid ""
"Like strings (and all other built-in :term:`sequence` type), lists can be "
"indexed and sliced::"
msgstr ""
"Como Strings (e todos os outros tipos built-in :term:`sequence`), as listas "
"podem ser indexadas e fatiadas::"
#: ../../tutorial/introduction.rst:490
msgid ""
"All slice operations return a new list containing the requested elements. "
"This means that the following slice returns a new (shallow) copy of the "
"list::"
msgstr ""
"Todas as operações de fatiamento devolvem uma nova lista contendo os "
"elementos\n"
"solicitados. Isto significa que o fatiamento a seguir retorna uma cópia "
"rasa\n"
"(*shallow copy*) da lista::"
#: ../../tutorial/introduction.rst:496
msgid "Lists also supports operations like concatenation::"
msgstr ""
#: ../../tutorial/introduction.rst:501
msgid ""
"Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` "
"type, i.e. it is possible to change their content::"
msgstr ""
"Diferentemente de strings, que são *imutáveis*, é possível alterar "
"elementos\n"
"individuais de uma lista::"
#: ../../tutorial/introduction.rst:511
msgid ""
"You can also add new items at the end of the list, by using the :meth:`~list."
"append` *method* (we will see more about methods later)::"
msgstr ""
"Você também pode adicionar novos itens no final da lista, usando o *método* :"
"meth:`~list.append` (estudaremos mais a respeito dos métodos "
"posteriormente)::"
#: ../../tutorial/introduction.rst:519
msgid ""
"Assignment to slices is also possible, and this can even change the size of "
"the list or clear it entirely::"
msgstr ""
"Atribuição à fatias também é possível, e isso pode até alterar o tamanho da\n"
"lista ou remover todos os itens dela::"
#: ../../tutorial/introduction.rst:538
msgid "The built-in function :func:`len` also applies to lists::"
msgstr "A função embutida :func:`len` também se aplica a listas::"
#: ../../tutorial/introduction.rst:544
msgid ""
"It is possible to nest lists (create lists containing other lists), for "
"example::"
msgstr ""
"É possível aninhar listas (criar listas contendo outras listas), por "
"exemplo::"
#: ../../tutorial/introduction.rst:560
msgid "First Steps Towards Programming"
msgstr "Primeiros passos para a programação"
#: ../../tutorial/introduction.rst:562
msgid ""
"Of course, we can use Python for more complicated tasks than adding two and "
"two together. For instance, we can write an initial sub-sequence of the "
"*Fibonacci* series as follows::"
msgstr ""
"Naturalmente, podemos utilizar Python para tarefas mais complicadas do que\n"
"somar 2+2. Por exemplo, podemos escrever o início da *sequência de "
"Fibonacci*\n"
"assim::"
#: ../../tutorial/introduction.rst:580
msgid "This example introduces several new features."
msgstr "Este exemplo introduz diversas características ainda não mencionadas."
#: ../../tutorial/introduction.rst:582
msgid ""
"The first line contains a *multiple assignment*: the variables ``a`` and "
"``b`` simultaneously get the new values 0 and 1. On the last line this is "
"used again, demonstrating that the expressions on the right-hand side are "
"all evaluated first before any of the assignments take place. The right-"
"hand side expressions are evaluated from the left to the right."
msgstr ""
"A primeira linha contém uma atribuição múltipla: as variáveis ``a`` e ``b``\n"
" recebem simultaneamente os novos valores 0 e 1. Na última linha há outro\n"
" exemplo de atribuição múltipla demonstrando que expressões do lado direito "
"são\n"
" sempre avaliadas primeiro, antes da atribuição. As expressões do lado "
"direito\n"
" são avaliadas da esquerda para a direita."
#: ../../tutorial/introduction.rst:588
msgid ""
"The :keyword:`while` loop executes as long as the condition (here: ``b < "
"10``) remains true. In Python, like in C, any non-zero integer value is "
"true; zero is false. The condition may also be a string or list value, in "
"fact any sequence; anything with a non-zero length is true, empty sequences "
"are false. The test used in the example is a simple comparison. The "
"standard comparison operators are written the same as in C: ``<`` (less "
"than), ``>`` (greater than), ``==`` (equal to), ``<=`` (less than or equal "
"to), ``>=`` (greater than or equal to) and ``!=`` (not equal to)."
msgstr ""
"O laço :keyword:`while` executa enquanto a condição (aqui: ``b < 10``)\n"
" permanecer verdadeira. Em Python, como em C, qualquer valor não-zero é\n"
" considerado verdadeiro, zero é considerado falso. A condição pode ser "
"ainda\n"
" uma lista ou string, na verdade qualquer sequência; qualquer coisa com\n"
" comprimento maior que zero tem valor verdadeiro e sequências vazias são\n"
" falsas. O teste utilizado no exemplo é uma comparação simples. Os "
"operadores\n"
" padrão para comparação são os mesmos de C: ``<`` (menor que), ``>`` (maior\n"
" que), ``==`` (igual), ``<=`` (menor ou igual), ``>=`` (maior ou igual) e\n"
" ``!=`` (diferente)."
#: ../../tutorial/introduction.rst:597
msgid ""
"The *body* of the loop is *indented*: indentation is Python's way of "
"grouping statements. At the interactive prompt, you have to type a tab or "
"space(s) for each indented line. In practice you will prepare more "
"complicated input for Python with a text editor; all decent text editors "
"have an auto-indent facility. When a compound statement is entered "
"interactively, it must be followed by a blank line to indicate completion "
"(since the parser cannot guess when you have typed the last line). Note "
"that each line within a basic block must be indented by the same amount."
msgstr ""
"O *corpo* do laço é *indentado*: indentação em Python é a maneira de "
"agrupar\n"
" comandos em blocos. No console interativo padrão você terá que digitar tab "
"ou\n"
" espaços para indentar cada linha. Na prática você vai preparar scripts "
"Python\n"
" mais complicados em um editor de texto; a maioria dos editores de texto "
"tem\n"
" facilidades de indentação automática. Quando um comando composto é "
"digitado\n"
" interativamente, deve ser finalizado por uma linha em branco (já que o\n"
" parser não tem como adivinhar qual é a última linha do comando). Observe "
"que\n"
" toda linha de um mesmo bloco de comandos deve ter a mesma indentação"
#: ../../tutorial/introduction.rst:606
msgid ""
"The :keyword:`print` statement writes the value of the expression(s) it is "
"given. It differs from just writing the expression you want to write (as we "
"did earlier in the calculator examples) in the way it handles multiple "
"expressions and strings. Strings are printed without quotes, and a space is "
"inserted between items, so you can format things nicely, like this::"
msgstr ""
"O comando :keyword:`print` escreve o valor da expressão ou expressões\n"
" fornecidas. É diferente de apenas escrever a expressão no interpretador\n"
" (como fizemos nos exemplos da calculadora) pela forma como lida com "
"múltiplas\n"
" expressões e strings. Strings são exibidas sem aspas, e um espaço é "
"inserido\n"
" entre os itens para formatar o resultado assim::"
#: ../../tutorial/introduction.rst:616
msgid "A trailing comma avoids the newline after the output::"
msgstr " Uma vírgula ao final evita a quebra de linha::"
#: ../../tutorial/introduction.rst:625
msgid ""
"Note that the interpreter inserts a newline before it prints the next prompt "
"if the last line was not completed."
msgstr ""
" Note que o interpretador insere uma quebra de linha antes de imprimir o "
"próximo prompt se a última linha não foi completada."
#: ../../tutorial/introduction.rst:629
msgid "Footnotes"
msgstr "Notas de Rodapé"
#: ../../tutorial/introduction.rst:630
msgid ""
"Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted "
"as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you "
"can use ``(-3)**2``."
msgstr ""
"Uma vez que ``**`` tem precedência mais alta que ``-``, ``-3**2`` será "
"interpretado como ``-(3**2)`` e assim resultará em ``-9``. Para evitar "
"isso e obter ``9``, você pode usar ``(-3)**2``."
#: ../../tutorial/introduction.rst:634
msgid ""
"Unlike other languages, special characters such as ``\\n`` have the same "
"meaning with both single (``'...'``) and double (``\"...\"``) quotes. The "
"only difference between the two is that within single quotes you don't need "
"to escape ``\"`` (but you have to escape ``\\'``) and vice versa."
msgstr ""
"Ao contrário de outras linguagens, caracteres especiais como ``\\n`` têm o "
"mesmo significado com as aspas simples (``'...'``) e duplas (``\"...\"``) . "
"A única diferença entre as duas é que, dentro de aspas simples, você não "
"precisa escapar o ``\"`` (mas você deve escapar a ``\\'``) e vice-versa."