Python Forum
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dictionary questions
#1


hi. i have two questions that i am stuck with in dictionarys. First one,
di1={5:'K',3:'A',2:'R',7:'T',4:'G',6:'S'}
di2={'GR':'Greece','IT':'Italy','ES':'Spain'}
print(len(di2[xxxx]))
it needs to replace xxx with something that print will output 6.



second,
di={'A':['a',41],'B':['b',42],'C':['c',43]}
s=0
for i in di:
    s+=yyy
print(s)
need to replace yyy with something that will print 126


please i am asking for your help.
Reply


Messages In This Thread
dictionary questions - by atux_null - Nov-08-2017, 08:59 PM
RE: dictionary questions - by Larz60+ - Nov-08-2017, 10:09 PM
RE: dictionary questions - by atux_null - Nov-09-2017, 07:04 AM
RE: dictionary questions - by Larz60+ - Nov-09-2017, 01:13 PM
RE: dictionary questions - by atux_null - Nov-09-2017, 03:00 PM
RE: dictionary questions - by heiner55 - Nov-10-2017, 01:33 AM
RE: dictionary questions - by VlaDimitris - Jun-20-2018, 01:44 PM
RE: dictionary questions - by Nwb - Jun-20-2018, 03:45 PM
RE: dictionary questions - by ljmetzger - Jun-20-2018, 07:00 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020