Question: Given the following code: string = 'success' d = { } for ch in letter: if ch not in d: d [ ch ] =

Given the following code:
string = 'success'
d ={}
for ch in letter:
if ch not in d:
d[ch]=1
else:
d[ch]+=1
What is the value of d?
Question 4 options:
{'s' : 3,'u':1,'c':2,' e':1}
{'r': 2,'u': 1,'n': 2,'e': 1}
{'s: 1,'u': 1,'c': 1,'c': 1,'e':1,'s': 2}
{'s' : 1,'u':1,'c':2,' e':1,'s':1}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!