I must substract from dictionary values.
list1 = {'i': 1, 'k': 1, 'j': 1, 'o': 2, 'q': 1, 's': 1, 'x': 1, 'z': 1}
string = 'ikjoosgx'
for letter in string:
I NEED TO DECREASE list1 key of same name as letter VALUE BY 1. DIPSIT!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Another solution, this time using the good old
setdefault: