Also, try (works for me in Python3)
rivers = {'nile' : 'egypt', 'ohio' : 'US', 'rhine' : 'germany' }
for key, value in rivers.items():
print (key)
for key, value in rivers.items():
print (value)
for key, value in rivers.items():
print ("The " + key + " is in the country of " + value)
Try
for river in rivers:
print ("The " + river + " is in the country of " + rivers[river])
On Wed, Oct 10, 2018 at 9:30 PM wrote:
> Send Tutor mailing list submissions to
> tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://mail.python.org/ma