In short, I get the above error when attempting to loop through the key-value pairs in a dictionary. I know the fix, but not the reason why.
webuser = {
"username": "JWick",
"first": "John",
"last": "Wick",
}
for key in webuser.items():
print("\nKey: " + key)
Correct:
for key, value in webuser.items():
print("\nKey: " + key)
print("value: " + value)
Is this because I am attempting to loop through two values and only using one variable to store & output? That way, the program attempts to concatenate the data in the dictionary in the variable and fails.