Python AttributeError: ‘dict’ object has no attribute ‘append’

Like the error message suggests, dictionaries in Python do not provide an append operation. You can instead just assign new values to their respective keys in a dictionary. If you’re wanting to append values as they’re entered you could instead use a list. Your line user[‘areas’].append[temp] looks like it is attempting to access a dictionary at the … Read more

Scanning Multiple inputs from one line using scanf

You have your printing loop inside your reading loop. It is trying to print out all of the trip information after reading the first one in. Edit: The trouble here is that the way scanf handles single characters is kinda unintuitive next to the way it handles strings and numbers. It reads the very next … Read more

“for loop” with two variables?

If you want the effect of a nested for loop, use: If you just want to loop simultaneously, use: Note that if x and y are not the same length, zip will truncate to the shortest list. As @abarnert pointed out, if you don’t want to truncate to the shortest list, you could use itertools.zip_longest. UPDATE Based on the request for “a … Read more