In [1]:
alien_0 = {'color': 'green', 'points' : 5}

In [2]:
print(alien_0['color'])
print(alien_0['points'])


green
5

Working with Dictionaries


In [3]:
new_points = alien_0['points']

In [4]:
print("Your new point is "+ str(new_points) + " points!")


Your new point is 5 points!

In [5]:
alien_0 = {'x-position': 5, 'y-position': 10}

In [8]:
alien_0['color'] = 'green'
alien_0['points'] = 10

In [9]:
alien_0


Out[9]:
{'color': 'green', 'points': 10, 'x-position': 5, 'y-position': 10}

In [ ]: