[ Web Proxy ]
URL:
Viewing:
https://github-redirect.dependabot.com/python/python-docs-pt-br/blob/3.7/tutorial/datastructures.po
[Back]
[Original]
python-docs-pt-br/tutorial/datastructures.po at 3.7 python/python-docs-pt-br GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
python
python-docs-pt-br
Repository navigation
Code
Issues
13
(13)
Pull requests
4
(4)
Actions
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
3.7
Breadcrumbs
python-docs-pt-br
/
tutorial
/
datastructures.po
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
816 lines (728 loc) 44.4 KB
3.7
Breadcrumbs
python-docs-pt-br
/
tutorial
/
datastructures.po
Copy path
Top
File metadata and controls
Code
Blame
816 lines (728 loc) 44.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
SOME DESCRIPTIVE TITLE.
#
Copyright (C) 2001-2023, Python Software Foundation
#
This file is distributed under the same license as the Python package.
#
FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#
Translators:
#
Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2019
#
Leticia Portella <leportella@gmail.com>, 2019
#
Cau Baasch de Souza <cauebaasch@gmail.com>, 2019
#
Victor Matheus Castro <victormatheuscastro@gmail.com>, 2019
#
Adorilson Bezerra <adorilson@gmail.com>, 2019
#
#,
fuzzy
msgid ""
msgstr ""
"
Project-Id-Version
:
Python 3.7\n
"
"
Report-Msgid-Bugs-To
:
\n
"
"
POT-Creation-Date
:
2023-06-23 16:56+0000\n
"
"
PO-Revision-Date
:
2019-09-01 02:41+0000\n
"
"
Last-Translator
:
Adorilson Bezerra <adorilson@gmail.com>, 2019\n
"
"
Language-Team
:
Portuguese (Brazil) (https://app.transifex.com/python-doc/
"
"
teams/5390/pt_BR/)\n
"
"
MIME-Version
:
1.0\n
"
"
Content-Type
:
text/plain; charset=UTF-8\n
"
"
Content-Transfer-Encoding
:
8bit\n
"
"
Language
:
pt_BR\n
"
"
Plural-Forms
:
nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n %
"
"
1000000 == 0 ? 1 : 2;\n
"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:5
msgid
"Data Structures"
msgstr
"Estruturas de dados"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:7
msgid
""
"This chapter describes some things you've learned about already in more "
"detail, and adds some new things as well."
msgstr
""
"Esse captulo descreve algumas coisas que voc j aprendeu em detalhes e "
"adiciona algumas coisas novas tambm."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:13
msgid
"More on Lists"
msgstr
"Mais sobre listas"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:15
msgid
""
"The list data type has some more methods. Here are all of the methods of "
"list objects:"
msgstr
""
"O tipo de dado lista tem ainda mais mtodos. Aqui esto apresentados todos "
"os mtodos de objetos do tipo lista:"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:22
msgid
""
"Add an item to the end of the list. Equivalent to ``a[len(a):] = [x]``."
msgstr
"Adiciona um item ao fim da lista. Equivalente a ``a[len(a):] = [x]``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:28
msgid
""
"Extend the list by appending all the items from the iterable. Equivalent to "
"``a[len(a):] = iterable``."
msgstr
""
"Prolonga a lista, adicionando no fim todos os elementos do argumento "
"`iterable` passado como parmetro. Equivalente a ``a[len(a):] = iterable``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:35
msgid
""
"Insert an item at a given position. The first argument is the index of the "
"element before which to insert, so ``a.insert(0, x)`` inserts at the front "
"of the list, and ``a.insert(len(a), x)`` is equivalent to ``a.append(x)``."
msgstr
""
"Insere um item em uma dada posio. O primeiro argumento o ndice do "
"elemento anterior ao qual voc deseja inserir, ento ``a.insert(0, x)`` "
"insere um elemento na frente da lista e ``a.insert(len(a), x)`` "
"equivalente a ``a.append(x)``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:43
msgid
""
"Remove the first item from the list whose value is equal to *x*. It raises "
"a :exc:`ValueError` if there is no such item."
msgstr
""
"Remove o primeiro item encontrado na lista cujo valor igual a *x*. Se no "
"existir valor igual, uma exceo :exc:`ValueError` levantada."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:50
msgid
""
"Remove the item at the given position in the list, and return it. If no "
"index is specified, ``a.pop()`` removes and returns the last item in the "
"list. (The square brackets around the *i* in the method signature denote "
"that the parameter is optional, not that you should type square brackets at "
"that position. You will see this notation frequently in the Python Library "
"Reference.)"
msgstr
""
"Remove um item em uma dada posio na lista e o retorna. Se nenhum ndice "
"especificado, ``a.pop()`` remove e retorna o ltimo item da lista. (Os "
"colchetes ao redor do *i* na demonstrao do mtodo indica que o parmetro "
"opcional, e no que necessrio escrever estes colchetes ao chamar o "
"mtodo. Voc ver este tipo de notao frequentemente na Biblioteca de "
"Referncia Python.)"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:60
msgid
"Remove all items from the list. Equivalent to ``del a[:]``."
msgstr
"Remove todos os itens de uma lista. Equivalente a ``del a[:]``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:66
msgid
""
"Return zero-based index in the list of the first item whose value is equal "
"to *x*. Raises a :exc:`ValueError` if there is no such item."
msgstr
""
"Devolve o ndice base-zero do primeiro item cujo valor igual a *x*, "
"levantando :exc:`ValueError` se este valor no existe."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:69
msgid
""
"The optional arguments *start* and *end* are interpreted as in the slice "
"notation and are used to limit the search to a particular subsequence of the "
"list. The returned index is computed relative to the beginning of the full "
"sequence rather than the *start* argument."
msgstr
""
"Os argumentos opcionais *start* e *end* so interpretados como nas notaes "
"de fatiamento e so usados para limitar a busca para uma subsequncia "
"especfica da lista. O ndice retornado calculado relativo ao comeo da "
"sequncia inteira e no referente ao argumento *start*."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:78
msgid
"Return the number of times *x* appears in the list."
msgstr
"Retorna o nmero de vezes em que *x* aparece na lista."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:84
msgid
""
"Sort the items of the list in place (the arguments can be used for sort "
"customization, see :func:`sorted` for their explanation)."
msgstr
""
"Ordena os itens na lista (os argumentos podem ser usados para personalizar a "
"ordenao, veja a funo :func:`sorted` para maiores explicaes)."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:91
msgid
"Reverse the elements of the list in place."
msgstr
"Inverte a ordem dos elementos na lista."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:97
msgid
"Return a shallow copy of the list. Equivalent to ``a[:]``."
msgstr
"Devolve uma cpia rasa da lista. Equivalente a ``a[:]``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:100
msgid
"An example that uses most of the list methods::"
msgstr
"Um exemplo que usa a maior parte dos mtodos das listas::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:123
msgid
""
"You might have noticed that methods like ``insert``, ``remove`` or ``sort`` "
"that only modify the list have no return value printed -- they return the "
"default ``None``. [1]_ This is a design principle for all mutable data "
"structures in Python."
msgstr
""
"Voc pode ter percebido que mtodos como ``insert``, ``remove`` ou ``sort``, "
"que apenas modificam a lista, no tm valor de retorno impresso -- eles "
"retornam o ``None`` padro. [1]_ Isto um princpio de design para todas "
"as estruturas de dados mutveis em Python."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:132
msgid
"Using Lists as Stacks"
msgstr
"Usando listas como pilhas"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:137
msgid
""
"The list methods make it very easy to use a list as a stack, where the last "
"element added is the first element retrieved (
\"
last-in, first-out
\"
). To "
"add an item to the top of the stack, use :meth:`append`. To retrieve an "
"item from the top of the stack, use :meth:`pop` without an explicit index. "
"For example::"
msgstr
""
"Os mtodos de lista tornam muito fcil utilizar listas como pilhas, onde o "
"item adicionado por ltimo o primeiro a ser recuperado (poltica ltimo a "
"entrar, primeiro a sair). Para adicionar um item ao topo da pilha, use :"
"meth:`append`. Para recuperar um item do topo da pilha use :meth:`pop` sem "
"nenhum ndice. Por exemplo::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:162
msgid
"Using Lists as Queues"
msgstr
"Usando listas como filas"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:166
msgid
""
"It is also possible to use a list as a queue, where the first element added "
"is the first element retrieved (
\"
first-in, first-out
\"
); however, lists are "
"not efficient for this purpose. While appends and pops from the end of list "
"are fast, doing inserts or pops from the beginning of a list is slow "
"(because all of the other elements have to be shifted by one)."
msgstr
""
"Voc tambm pode usar uma lista como uma fila, onde o primeiro item "
"adicionado o primeiro a ser recuperado (poltica primeiro a entrar, "
"primeiro a sair); porm, listas no so eficientes para esta finalidade. "
"Embora *appends* e *pops* no final da lista sejam rpidos, fazer *inserts* "
"ou *pops* no incio da lista lento (porque todos os demais elementos tm "
"que ser deslocados)."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:172
msgid
""
"To implement a queue, use :class:`collections.deque` which was designed to "
"have fast appends and pops from both ends. For example::"
msgstr
""
"Para implementar uma fila, use a classe :class:`collections.deque` que foi "
"projetada para permitir *appends* e *pops* eficientes nas duas extremidades. "
"Por exemplo::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:190
msgid
"List Comprehensions"
msgstr
"Compreenses de lista"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:192
msgid
""
"List comprehensions provide a concise way to create lists. Common "
"applications are to make new lists where each element is the result of some "
"operations applied to each member of another sequence or iterable, or to "
"create a subsequence of those elements that satisfy a certain condition."
msgstr
""
"Compreenses de lista fornece uma maneira concisa de criar uma lista. "
"Aplicaes comuns so criar novas listas onde cada elemento o resultado de "
"alguma operao aplicada a cada elemento de outra sequncia ou itervel, ou "
"criar uma subsequncia de elementos que satisfaam uma certa condio. (N.d."
"T. o termo original em ingls *list comprehensions*, muito utilizado no "
"Brasil; tambm se usa a abreviao *listcomp*)."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:197
msgid
"For example, assume we want to create a list of squares, like::"
msgstr
""
"Por exemplo, suponha que queremos criar uma lista de quadrados, assim::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:206
msgid
""
"Note that this creates (or overwrites) a variable named ``x`` that still "
"exists after the loop completes. We can calculate the list of squares "
"without any side effects using::"
msgstr
""
"Note que isto cria (ou sobrescreve) uma varivel chamada ``x`` que ainda "
"existe aps o trmino do lao. Podemos calcular a lista dos quadrados sem "
"qualquer efeito colateral usando::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:212
msgid
"or, equivalently::"
msgstr
"ou, de maneira equivalente::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:216
msgid
"which is more concise and readable."
msgstr
"que mais conciso e legvel."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:218
msgid
""
"A list comprehension consists of brackets containing an expression followed "
"by a :keyword:`!for` clause, then zero or more :keyword:`!for` or :keyword:`!"
"if` clauses. The result will be a new list resulting from evaluating the "
"expression in the context of the :keyword:`!for` and :keyword:`!if` clauses "
"which follow it. For example, this listcomp combines the elements of two "
"lists if they are not equal::"
msgstr
""
"Um compreenso de lista consiste de um par de colchetes contendo uma "
"expresso seguida de uma clusula :keyword:`!for`, e ento zero ou mais "
"clusulas :keyword:`!for` ou :keyword:`!if`. O resultado ser uma nova "
"lista resultante da avaliao da expresso no contexto das clusulas :"
"keyword:`!for` e :keyword:`!if`. Por exemplo, essa compreenso combina os "
"elementos de duas listas se eles forem diferentes::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:228
msgid
"and it's equivalent to::"
msgstr
"e equivalente a::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:239
msgid
""
"Note how the order of the :keyword:`for` and :keyword:`if` statements is the "
"same in both these snippets."
msgstr
""
"Note como a ordem das instrues :keyword:`for` e :keyword:`if` a mesma em "
"ambos os trechos."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:242
msgid
""
"If the expression is a tuple (e.g. the ``(x, y)`` in the previous example), "
"it must be parenthesized. ::"
msgstr
""
"Se a expresso uma tupla (ex., ``(x, y)`` no exemplo anterior), ela deve "
"ser inserida entre parnteses. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:273
msgid
""
"List comprehensions can contain complex expressions and nested functions::"
msgstr
""
"Compreenses de lista podem conter expresses complexas e funes aninhadas::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:280
msgid
"Nested List Comprehensions"
msgstr
"Compreenses de lista aninhadas"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:282
msgid
""
"The initial expression in a list comprehension can be any arbitrary "
"expression, including another list comprehension."
msgstr
""
"A expresso inicial em uma list comprehension pode ser qualquer expresso "
"arbitrria, incluindo outra list comprehension."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:285
msgid
""
"Consider the following example of a 3x4 matrix implemented as a list of 3 "
"lists of length 4::"
msgstr
""
"Observe este exemplo de uma matriz 3x4 implementada como uma lista de 3 "
"listas de comprimento 4::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:294
msgid
"The following list comprehension will transpose rows and columns::"
msgstr
"A compreenso de listas abaixo transpe as linhas e colunas::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:299
msgid
""
"As we saw in the previous section, the nested listcomp is evaluated in the "
"context of the :keyword:`for` that follows it, so this example is equivalent "
"to::"
msgstr
""
"Como vimos na seo anterior, a compreenso de lista aninhada computada no "
"contexto da clusula :keyword:`for` seguinte, portanto o exemplo acima "
"equivale a::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:310
msgid
"which, in turn, is the same as::"
msgstr
"e isso, por sua vez, faz o mesmo que isto::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:323
msgid
""
"In the real world, you should prefer built-in functions to complex flow "
"statements. The :func:`zip` function would do a great job for this use case::"
msgstr
""
"Na prtica, voc deve dar preferncia a funes embutidas em vez de "
"expresses complexas. A funo :func:`zip` resolve muito bem este caso de "
"uso::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:329
msgid
""
"See :ref:`tut-unpacking-arguments` for details on the asterisk in this line."
msgstr
""
"Veja :ref:`tut-unpacking-arguments` para entender o uso do asterisco neste "
"exemplo."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:334
msgid
"The :keyword:`!del` statement"
msgstr
"A instruo :keyword:`!del`"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:336
msgid
""
"There is a way to remove an item from a list given its index instead of its "
"value: the :keyword:`del` statement. This differs from the :meth:`pop` "
"method which returns a value. The :keyword:`!del` statement can also be "
"used to remove slices from a list or clear the entire list (which we did "
"earlier by assignment of an empty list to the slice). For example::"
msgstr
""
"Existe uma maneira de remover um item de uma lista usando seu ndice no "
"lugar do seu valor: a instruo :keyword:`del`. Ele difere do mtodo :meth:"
"`pop` que retorna um valor. A instruo :keyword:`!del` pode tambm ser "
"utilizada para remover fatias de uma lista ou limpar a lista inteira (que "
"fizemos antes atribuindo uma lista vazia fatia ``a[:]``). Por exemplo:: "
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:353
msgid
":keyword:`del` can also be used to delete entire variables::"
msgstr
""
":keyword:`del` tambm pode ser usado para remover totalmente uma varivel::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:357
msgid
""
"Referencing the name ``a`` hereafter is an error (at least until another "
"value is assigned to it). We'll find other uses for :keyword:`del` later."
msgstr
""
"Referenciar a varivel ``a`` depois de sua remoo constitui erro (pelo "
"menos at que seja feita uma nova atribuio para ela). Encontraremos outros "
"usos para a instruo :keyword:`del` mais tarde."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:364
msgid
"Tuples and Sequences"
msgstr
"Tuplas e Sequncias"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:366
msgid
""
"We saw that lists and strings have many common properties, such as indexing "
"and slicing operations. They are two examples of *sequence* data types "
"(see :ref:`typesseq`). Since Python is an evolving language, other sequence "
"data types may be added. There is also another standard sequence data type: "
"the *tuple*."
msgstr
""
"Vimos que listas e strings tm muitas propriedades em comum, como indexao "
"e operaes de fatiamento. Elas so dois exemplos de *sequncias* (veja :ref:"
"`typesseq`). Como Python uma linguagem em evoluo, outros tipos de "
"sequncias podem ser adicionados. Existe ainda um outro tipo de sequncia "
"padro na linguagem: a *tupla*."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:372
msgid
""
"A tuple consists of a number of values separated by commas, for instance::"
msgstr
""
"Uma tupla consiste em uma sequncia de valores separados por vrgulas, por "
"exemplo::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:394
msgid
""
"As you see, on output tuples are always enclosed in parentheses, so that "
"nested tuples are interpreted correctly; they may be input with or without "
"surrounding parentheses, although often parentheses are necessary anyway (if "
"the tuple is part of a larger expression). It is not possible to assign to "
"the individual items of a tuple, however it is possible to create tuples "
"which contain mutable objects, such as lists."
msgstr
""
"Como voc pode ver no trecho acima, na sada do console as tuplas so sempre "
"envolvidas por parnteses, assim tuplas aninhadas podem ser lidas "
"corretamente. Na criao, tuplas podem ser envolvidas ou no por parnteses, "
"desde que o contexto no exija os parnteses (como no caso da tupla dentro "
"de uma expresso maior). No possvel atribuir itens individuais de uma "
"tupla, contudo possvel criar tuplas que contenham objetos mutveis, como "
"listas."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:401
msgid
""
"Though tuples may seem similar to lists, they are often used in different "
"situations and for different purposes. Tuples are :term:`immutable`, and "
"usually contain a heterogeneous sequence of elements that are accessed via "
"unpacking (see later in this section) or indexing (or even by attribute in "
"the case of :func:`namedtuples <collections.namedtuple>`). Lists are :term:"
"`mutable`, and their elements are usually homogeneous and are accessed by "
"iterating over the list."
msgstr
""
"Apesar de tuplas serem similares a listas, elas so frequentemente "
"utilizadas em situaes diferentes e com propsitos distintos. Tuplas so :"
"term:`imutveis <imutvel>`, e usualmente contm uma sequncia heterognea "
"de elementos que so acessados via desempacotamento (ver a seguir nessa "
"seo) ou ndice (ou mesmo por um atributo no caso de :func:`namedtuples "
"<collections.namedtuple>`). Listas so :term:`mutveis <mutvel>`, e seus "
"elementos geralmente so homogneos e so acessados iterando sobre a lista."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:409
msgid
""
"A special problem is the construction of tuples containing 0 or 1 items: the "
"syntax has some extra quirks to accommodate these. Empty tuples are "
"constructed by an empty pair of parentheses; a tuple with one item is "
"constructed by following a value with a comma (it is not sufficient to "
"enclose a single value in parentheses). Ugly, but effective. For example::"
msgstr
""
"Um problema especial a criao de tuplas contendo 0 ou 1 itens: a sintaxe "
"usa certos truques para acomodar estes casos. Tuplas vazias so construdas "
"por uma par de parnteses vazios; uma tupla unitria construda por um "
"nico valor e uma vrgula entre parnteses (no basta colocar um nico valor "
"entre parnteses). Feio, mas funciona. Por exemplo::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:424
msgid
""
"The statement ``t = 12345, 54321, 'hello!'`` is an example of *tuple "
"packing*: the values ``12345``, ``54321`` and ``'hello!'`` are packed "
"together in a tuple. The reverse operation is also possible::"
msgstr
""
"A instruo ``t = 12345, 54321, 'bom dia!'`` um exemplo de *empacotamento "
"de tupla*: os valores ``12345``, ``54321`` e ``'bom dia!'`` so empacotados "
"em uma tupla. A operao inversa tambm possvel::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:430
msgid
""
"This is called, appropriately enough, *sequence unpacking* and works for any "
"sequence on the right-hand side. Sequence unpacking requires that there are "
"as many variables on the left side of the equals sign as there are elements "
"in the sequence. Note that multiple assignment is really just a combination "
"of tuple packing and sequence unpacking."
msgstr
""
"Isso chamado, apropriadamente, de *sequncia de desempacotamento* e "
"funciona para qualquer sequncia no lado direito. O desempacotamento de "
"sequncia requer que haja tantas variveis no lado esquerdo do sinal de "
"igual, quanto existem de elementos na sequncia. Observe que a atribuio "
"mltipla , na verdade, apenas uma combinao de empacotamento de tupla e "
"desempacotamento de sequncia."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:440
msgid
"Sets"
msgstr
"Conjuntos"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:442
msgid
""
"Python also includes a data type for *sets*. A set is an unordered "
"collection with no duplicate elements. Basic uses include membership "
"testing and eliminating duplicate entries. Set objects also support "
"mathematical operations like union, intersection, difference, and symmetric "
"difference."
msgstr
""
"Python tambm inclui um tipo de dados para conjuntos, chamado ``set``. Um "
"conjunto uma coleo desordenada de elementos, sem elementos repetidos. "
"Usos comuns para conjuntos incluem a verificao eficiente da existncia de "
"objetos e a eliminao de itens duplicados. Conjuntos tambm suportam "
"operaes matemticas como unio, interseo, diferena e diferena "
"simtrica."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:447
msgid
""
"Curly braces or the :func:`set` function can be used to create sets. Note: "
"to create an empty set you have to use ``set()``, not ``{}``; the latter "
"creates an empty dictionary, a data structure that we discuss in the next "
"section."
msgstr
""
"Chaves ou a funo :func:`set` podem ser usados para criar conjuntos. Note: "
"para criar um conjunto vazio voc precisa usar ``set()``, no ``{}``; este "
"ltimo cria um dicionrio vazio, uma estrutura de dados que discutiremos na "
"prxima seo."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:451
msgid
"Here is a brief demonstration::"
msgstr
"Uma pequena demonstrao:"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:476
msgid
""
"Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions "
"are also supported::"
msgstr
""
"Da mesma forma que :ref:`compreenso de listas <tut-listcomps>`, "
"compreenses de conjunto tambm so suportadas::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:487
msgid
"Dictionaries"
msgstr
"Dicionrios"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:489
msgid
""
"Another useful data type built into Python is the *dictionary* (see :ref:"
"`typesmapping`). Dictionaries are sometimes found in other languages as "
"
\"
associative memories
\"
or
\"
associative arrays
\"
. Unlike sequences, which "
"are indexed by a range of numbers, dictionaries are indexed by *keys*, which "
"can be any immutable type; strings and numbers can always be keys. Tuples "
"can be used as keys if they contain only strings, numbers, or tuples; if a "
"tuple contains any mutable object either directly or indirectly, it cannot "
"be used as a key. You can't use lists as keys, since lists can be modified "
"in place using index assignments, slice assignments, or methods like :meth:"
"`append` and :meth:`extend`."
msgstr
""
"Outra estrutura de dados muito til embutida em Python o *dicionrio*, "
"cujo tipo ``dict`` (ver :ref:`typesmapping`). Dicionrios so tambm "
"chamados de memria associativa ou vetor associativo em outras "
"linguagens. Diferente de sequncias que so indexadas por inteiros, "
"dicionrios so indexados por chaves (*keys*), que podem ser de qualquer "
"tipo imutvel (como strings e inteiros). Tuplas tambm podem ser chaves se "
"contiverem apenas strings, inteiros ou outras tuplas. Se a tupla contiver, "
"direta ou indiretamente, qualquer valor mutvel, no poder ser chave. "
"Listas no podem ser usadas como chaves porque podem ser modificadas "
"*internamente* pela atribuio em ndices ou fatias, e por mtodos como :"
"meth:`append` e :meth:`extend`."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:500
msgid
""
"It is best to think of a dictionary as a set of *key: value* pairs, with the "
"requirement that the keys are unique (within one dictionary). A pair of "
"braces creates an empty dictionary: ``{}``. Placing a comma-separated list "
"of key:value pairs within the braces adds initial key:value pairs to the "
"dictionary; this is also the way dictionaries are written on output."
msgstr
""
"Um bom modelo mental imaginar um dicionrio como um conjunto no-ordenado "
"de pares *chave: valor*, onde as chaves so nicas em uma dada instncia do "
"dicionrio. Dicionrios so delimitados por chaves: ``{}``, e contm uma "
"lista de pares chave:valor separada por vrgulas. Dessa forma tambm ser "
"exibido o contedo de um dicionrio no console do Python. O dicionrio vazio "
" ``{}``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:506
msgid
""
"The main operations on a dictionary are storing a value with some key and "
"extracting the value given the key. It is also possible to delete a key:"
"value pair with ``del``. If you store using a key that is already in use, "
"the old value associated with that key is forgotten. It is an error to "
"extract a value using a non-existent key."
msgstr
""
"As principais operaes em um dicionrio so armazenar e recuperar valores a "
"partir de chaves. Tambm possvel remover um par *chave:valor* com o "
"comando ``del``. Se voc armazenar um valor utilizando uma chave j "
"presente, o antigo valor ser substitudo pelo novo. Se tentar recuperar um "
"valor usando uma chave inexistente, ser gerado um erro."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:512
msgid
""
"Performing ``list(d)`` on a dictionary returns a list of all the keys used "
"in the dictionary, in insertion order (if you want it sorted, just use "
"``sorted(d)`` instead). To check whether a single key is in the dictionary, "
"use the :keyword:`in` keyword."
msgstr
""
"Executar ``list(d)`` em um dicionrio devolve a lista de todas as chaves "
"presentes no dicionrio, na ordem de insero (se desejar orden-las basta "
"aplicar o a funo ``sorted(d)`` lista devolvida). Para verificar a "
"existncia de uma chave, use o operador :keyword:`in`."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:517
msgid
"Here is a small example using a dictionary::"
msgstr
"A seguir, um exemplo de uso do dicionrio:"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:538
msgid
""
"The :func:`dict` constructor builds dictionaries directly from sequences of "
"key-value pairs::"
msgstr
""
"O construtor :func:`dict` produz dicionrios diretamente de sequncias de "
"pares chave-valor::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:544
msgid
""
"In addition, dict comprehensions can be used to create dictionaries from "
"arbitrary key and value expressions::"
msgstr
""
"Alm disso, os compreenso de dicionrios podem ser usadas para criar "
"dicionrios a partir de expresses arbitrrias de chave e valor::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:550
msgid
""
"When the keys are simple strings, it is sometimes easier to specify pairs "
"using keyword arguments::"
msgstr
""
"Quando chaves so strings simples, mais fcil especificar os pares usando "
"argumentos nomeados no construtor:"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:560
msgid
"Looping Techniques"
msgstr
"Tcnicas de iterao"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:562
msgid
""
"When looping through dictionaries, the key and corresponding value can be "
"retrieved at the same time using the :meth:`items` method. ::"
msgstr
""
"Ao iterar sobre dicionrios, a chave e o valor correspondente podem ser "
"obtidos simultaneamente usando o mtodo :meth:`items`. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:572
msgid
""
"When looping through a sequence, the position index and corresponding value "
"can be retrieved at the same time using the :func:`enumerate` function. ::"
msgstr
""
"Ao iterar sobre sequncias, a posio e o valor correspondente podem ser "
"obtidos simultaneamente usando a funo :func:`enumerate`. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:582
msgid
""
"To loop over two or more sequences at the same time, the entries can be "
"paired with the :func:`zip` function. ::"
msgstr
""
"Para percorrer duas ou mais sequncias ao mesmo tempo, as entradas podem ser "
"pareadas com a funo :func:`zip`. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:594
msgid
""
"To loop over a sequence in reverse, first specify the sequence in a forward "
"direction and then call the :func:`reversed` function. ::"
msgstr
""
"Para percorrer uma sequncia em ordem inversa, chame a funo :func:"
"`reversed` com a sequncia na ordem original. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:606
msgid
""
"To loop over a sequence in sorted order, use the :func:`sorted` function "
"which returns a new sorted list while leaving the source unaltered. ::"
msgstr
""
"Para percorrer uma sequncia de maneira ordenada, use a funo :func:"
"`sorted`, que retorna uma lista ordenada com os itens, mantendo a sequncia "
"original inalterada. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:618
msgid
""
"It is sometimes tempting to change a list while you are looping over it; "
"however, it is often simpler and safer to create a new list instead. ::"
msgstr
""
"s vezes tentador alterar uma lista enquanto voc itera sobre ela; porm, "
"costuma ser mais simples e seguro criar uma nova lista. ::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:635
msgid
"More on Conditions"
msgstr
"Mais sobre condies"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:637
msgid
""
"The conditions used in ``while`` and ``if`` statements can contain any "
"operators, not just comparisons."
msgstr
""
"As condies de controle usadas em ``while`` e ``if`` podem conter quaisquer "
"operadores, no apenas comparaes."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:640
msgid
""
"The comparison operators ``in`` and ``not in`` check whether a value occurs "
"(does not occur) in a sequence. The operators ``is`` and ``is not`` compare "
"whether two objects are really the same object; this only matters for "
"mutable objects like lists. All comparison operators have the same "
"priority, which is lower than that of all numerical operators."
msgstr
""
"Os operadores de comparao ``in`` e ``not in`` verificam se um valor ocorre "
"(ou no ocorre) em uma dada sequncia. Os operadores ``is`` e ``is not`` "
"comparam se dois objetos so na verdade o mesmo objeto; isto s relevante "
"no contexto de objetos mutveis, como listas. Todos os operadores de "
"comparao possuem a mesma precedncia, que menor do que a prioridade de "
"todos os operadores numricos."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:646
msgid
""
"Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` "
"is less than ``b`` and moreover ``b`` equals ``c``."
msgstr
""
"Comparaes podem ser encadeadas: Por exemplo ``a < b == c`` testa se ``a`` "
" menor que ``b`` e tambm se ``b`` igual a ``c``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:649
msgid
""
"Comparisons may be combined using the Boolean operators ``and`` and ``or``, "
"and the outcome of a comparison (or of any other Boolean expression) may be "
"negated with ``not``. These have lower priorities than comparison "
"operators; between them, ``not`` has the highest priority and ``or`` the "
"lowest, so that ``A and not B or C`` is equivalent to ``(A and (not B)) or "
"C``. As always, parentheses can be used to express the desired composition."
msgstr
""
"Comparaes podem ser combinadas atravs de operadores booleanos ``and`` e "
"``or``, e o resultado de uma comparao (ou de qualquer outra expresso), "
"pode ter seu valor booleano negado atravs de ``not``. Estes possuem menor "
"prioridade que os demais operadores de comparao. Entre eles, ``not`` o "
"de maior prioridade e ``or`` o de menor. Dessa forma, a condio ``A and not "
"B or C`` equivalente a ``(A and (not B)) or C``. Naturalmente, parnteses "
"podem ser usados para expressar o agrupamento desejado."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:656
msgid
""
"The Boolean operators ``and`` and ``or`` are so-called *short-circuit* "
"operators: their arguments are evaluated from left to right, and evaluation "
"stops as soon as the outcome is determined. For example, if ``A`` and ``C`` "
"are true but ``B`` is false, ``A and B and C`` does not evaluate the "
"expression ``C``. When used as a general value and not as a Boolean, the "
"return value of a short-circuit operator is the last evaluated argument."
msgstr
""
"Os operadores booleanos ``and`` e ``or`` so operadores *short-circuit*: "
"seus argumentos so avaliados da esquerda para a direita, e a avaliao para "
"quando o resultado determinado. Por exemplo, se ``A`` e ``C`` so "
"expresses verdadeiras, mas ``B`` falsa, ento ``A and B and C`` no chega "
"a avaliar a expresso ``C``. Em geral, quando usado sobre valores genricos "
"e no como booleanos, o valor do resultado de um operador atalho o ltimo "
"valor avaliado na expresso."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:663
msgid
""
"It is possible to assign the result of a comparison or other Boolean "
"expression to a variable. For example, ::"
msgstr
""
" possvel atribuir o resultado de uma comparao ou outra expresso "
"booleana para uma varivel. Por exemplo::"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:671
msgid
""
"Note that in Python, unlike C, assignment cannot occur inside expressions. C "
"programmers may grumble about this, but it avoids a common class of problems "
"encountered in C programs: typing ``=`` in an expression when ``==`` was "
"intended."
msgstr
""
"Observe que em Python, diferente de C, atribuio no pode ocorrer dentro de "
"uma expresso. Programadores C podem resmungar, mas isso evita toda uma "
"classe de problemas frequentemente encontrados em programas C: digitar ``=`` "
"numa expresso quando a inteno era ``==``."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:680
msgid
"Comparing Sequences and Other Types"
msgstr
"Comparando sequncias e outros tipos"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:682
msgid
""
"Sequence objects may be compared to other objects with the same sequence "
"type. The comparison uses *lexicographical* ordering: first the first two "
"items are compared, and if they differ this determines the outcome of the "
"comparison; if they are equal, the next two items are compared, and so on, "
"until either sequence is exhausted. If two items to be compared are "
"themselves sequences of the same type, the lexicographical comparison is "
"carried out recursively. If all items of two sequences compare equal, the "
"sequences are considered equal. If one sequence is an initial sub-sequence "
"of the other, the shorter sequence is the smaller (lesser) one. "
"Lexicographical ordering for strings uses the Unicode code point number to "
"order individual characters. Some examples of comparisons between sequences "
"of the same type::"
msgstr
""
"Objetos sequncia podem ser comparados com outros objetos sequncia, desde "
"que o tipo das sequncias seja o mesmo. A comparao utiliza a ordem "
"lexicogrfica: primeiramente os dois primeiros itens so comparados, e se "
"diferirem isto determinar o resultado da comparao, caso contrrio os "
"prximos dois itens sero comparados, e assim por diante at que se tenha "
"exaurido alguma das sequncias. Se em uma comparao de itens, os mesmos "
"forem tambm sequncias (aninhadas), ento disparada recursivamente outra "
"comparao lexicogrfica. Se todos os itens da sequncia forem iguais, ento "
"as sequncias so ditas iguais. Se uma das sequncias uma subsequncia da "
"outra, ento a subsequncia a menor. A comparao lexicogrfica de strings "
"codificao Unicode para definir a ordenao. Alguns exemplos de comparaes "
"entre sequncias do mesmo tipo:"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:702
msgid
""
"Note that comparing objects of different types with ``<`` or ``>`` is legal "
"provided that the objects have appropriate comparison methods. For example, "
"mixed numeric types are compared according to their numeric value, so 0 "
"equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, "
"the interpreter will raise a :exc:`TypeError` exception."
msgstr
""
"Note que comparar objetos de tipos diferentes com ``<`` ou ``>`` permitido "
"desde que os objetos possuam os mtodos de comparao apropriados. Por "
"exemplo, tipos numricos mistos so comparados de acordo com os seus valores "
"numricos, portanto 0 igual a 0.0, etc. Em caso contrrio, ao invs de "
"fornecer uma ordenao arbitrria, o interpretador levantar um :exc:"
"`TypeError`."
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:710
msgid
"Footnotes"
msgstr
"Notas de rodap"
#:
/home/runner/work/python-docs-tx-translations/python-docs-tx-translations/cpython/Doc/tutorial/datastructures.rst:711
msgid
""
"Other languages may return the mutated object, which allows method chaining, "
"such as ``d->insert(
\"
a
\"
)->remove(
\"
b
\"
)->sort();``."
msgstr
""
"Outras linguagens podem retornar o objeto modificado, o que permite "
"encadeamento de mtodos, como ``d->insert(
\"
a
\"
)->remove(
\"
b
\"
)->sort();``."
Footer
© 2026 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Community
Docs
Contact
Manage cookies
Do not share my personal information
You cant perform that action at this time.
Web Proxy Viewer |
New URL
|
Original Page