CodeLab Solution 51265
Create a dictionary that maps the first n counting numbers to their squares. Associate the dictionary with the variable squares.
[cc lang=”PYTHON”]
squares=dict((n,n**2) for n in range(1,n+1))
[/cc]
Create a dictionary that maps the first n counting numbers to their squares. Associate the dictionary with the variable squares.
[cc lang=”PYTHON”]
squares=dict((n,n**2) for n in range(1,n+1))
[/cc]
facebook