Python Dictionary by robioulsany

View this thread on steempeak.com
· @robioulsany ·
$0.02
Python Dictionary
## 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')])
👍  , , , , , , , , , , , ,
properties (23)
post_id61,667,445
authorrobioulsany
permlinkpython-dictionary
categorypython
json_metadata{"format":"markdown","app":"steemit\/0.1","tags":["python","dictionary","steemitbd","steemtuner","esteem"]}
created2018-09-05 16:38:00
last_update2018-09-05 16:38:00
depth0
children1
net_rshares21,588,950,673
last_payout2018-09-12 16:38:00
cashout_time1969-12-31 23:59:59
total_payout_value0.020 SBD
curator_payout_value0.003 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length664
author_reputation86,209,585,215
root_title"Python Dictionary"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (13)
@steemitbd ·
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!
properties (22)
post_id61,759,278
authorsteemitbd
permlinkre-robioulsany-python-dictionary-20180906t162349641z
categorypython
json_metadata{}
created2018-09-06 16:23:48
last_update2018-09-06 16:23:48
depth1
children0
net_rshares0
last_payout2018-09-13 16:23:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,096
author_reputation6,134,480,323,340
root_title"Python Dictionary"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000