The code you provided contains an error. Specifically, the method vals() does not exist for dictionary objects in Python. The correct method to retrieve the values of a dictionary is values().
Here's the corrected version of the code:
data = {'1': '0', '0': '1'}
for d in data.values():
print(d, end='')
AttributeError: 'dict' object has no attribute 'vals'
data.values() is the correct method
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
hovnival
1 month, 1 week agoNfyughguygjhg
2 months agoVano1
3 months agopescamillam
3 months, 1 week agoSarangM
3 months, 2 weeks agoRagoo
3 months, 2 weeks agoVano1
3 months agomegan_mai
5 months, 1 week ago