## How to create dictionary in Python? (curly braces) {} creates a key-value pair with a colon (:) in the bracket and a single dictionary is created separately with a comma (,) for each pair. In addition, you can also create a dictionary with the dict () function. Let's look at some examples: ### Try this code: <p># empty dictionary </p> my_dict = {} <p># dictionary with integer keys</p> my_dict = {1: 'apple', 2: 'ball'} <p># dictionary with mixed keys</p> my_dict = {'name': 'Maruf', 1: [2, 4, 3]} <p># using dict()</p> my_dict = dict({1:'apple', 2:'ball'}) <p># from sequence having each item as a pair</p> my_dict = dict([(1,'apple'), (2,'ball')])
post_id | 61,667,445 |
---|---|
author | robioulsany |
permlink | python-dictionary |
category | python |
json_metadata | {"format":"markdown","app":"steemit\/0.1","tags":["python","dictionary","steemitbd","steemtuner","esteem"]} |
created | 2018-09-05 16:38:00 |
last_update | 2018-09-05 16:38:00 |
depth | 0 |
children | 1 |
net_rshares | 21,588,950,673 |
last_payout | 2018-09-12 16:38:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.020 SBD |
curator_payout_value | 0.003 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 664 |
author_reputation | 86,209,585,215 |
root_title | "Python Dictionary" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
steemitbd | 0 | 15,101,376,749 | 20% | ||
sourovafrin | 0 | 804,424,743 | 1.9% | ||
steemtaker | 0 | 240,137,595 | 0.4% | ||
jahedkhan | 0 | 71,349,409 | 1% | ||
tjoet | 0 | 2,985,373,669 | 100% | ||
yati | 0 | 955,330,255 | 100% | ||
robioulsany | 0 | 537,935,745 | 100% | ||
sfturzo | 0 | 121,967,383 | 20% | ||
wrestleredoy | 0 | 259,340,023 | 50% | ||
mhmuhib | 0 | 60,816,943 | 10% | ||
tazinidos | 0 | 60,807,006 | 10% | ||
rajan019128 | 0 | 271,742,971 | 100% | ||
iamtaheed | 0 | 118,348,182 | 20% |
Congratulations! This post has been upvoted from Steemit Bangladesh, @steemitbd. It's the first steemit community project run by Bangladeshi steemians to empower youths from Bangladesh through STEEM blockchain. If you are from Bangladesh and looking for community support, Join [Steemit Bangladesh Discord Server](https://discord.gg/AY5cEj8). If you would like to delegate to the Steemit Bangladesh, you can do so by clicking on the following links: [50 SP](https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemitbd&vesting_shares=50%20SP), [100 SP](https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemitbd&vesting_shares=100%20SP), [250 SP](https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemitbd&vesting_shares=250%20SP), [500 SP](https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemitbd&vesting_shares=500%20SP), [1000 SP](https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=steemitbd&vesting_shares=1000%20SP). YOU ARE INVITED TO JOIN THE SERVER!
post_id | 61,759,278 |
---|---|
author | steemitbd |
permlink | re-robioulsany-python-dictionary-20180906t162349641z |
category | python |
json_metadata | {} |
created | 2018-09-06 16:23:48 |
last_update | 2018-09-06 16:23:48 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-09-13 16:23:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,096 |
author_reputation | 6,134,480,323,340 |
root_title | "Python Dictionary" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |