FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
tutorials/python-tutorials/dics_example.py at main · ackercode/tutorials · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ackercode
/
tutorials
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
14
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
tutorials
/
python-tutorials
/
dics_example.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (11 loc) · 635 Bytes
Breadcrumbs
tutorials
/
python-tutorials
/
dics_example.py
Copy path
File metadata and controls
16 lines (11 loc) · 635 Bytes
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
# ==== Diferentes formas de criar dicionários com Python ===== #
contatos_one
=
{
'Ale'
:
'1234-5378'
,
'Pedro'
:
'9999-9999'
}
#{'Ale': '1234-5378', 'Pedro', '9999-9999'}
contatos_two
=
dict
(
Ale
=
'1234-5378'
,
Pedro
=
'9999-9999'
)
#{'Ale': '1234-5378', 'Pedro', '9999-9999'}
contatos_lista
=
dict
([(
'Mari'
,
'1234-5678'
), (
'Pedro'
,
'9999-9999'
),
(
'Ana'
,
'8765-4321'
), (
'Barbara'
,
'8877-7788'
)])
#{'Yan': '1234-5678', 'Pedro': '9999-9999', 'Ana': '8765-4321', 'Marina': '8877-7788'}
contatos_zip
=
dict
(
zip
([
'Ale'
,
'Pedro'
], [
'1234-5378'
,
'9999-9999'
]))
#{'Ale': '1234-5378', 'Pedro', '9999-9999'}
print
(
contatos_lista
)
Back
|
FazBrowse Home
|
New Git URL