Sunday, August 10, 2014

Day 127

Python at CodeCademy. Worked on Python tutorial 9 of 14, Python Lists and Dictionaries: More with 'for'! Worked on sort.

The code used:
start_list = [5, 3, 1, 2, 4]
square_list = []

for number in start_list:
    square_list.append(number ** 2)
square_list.sort()# Your code here!

print square_list

The interaction for this code:
[1, 4, 9, 16, 25]

No comments:

Post a Comment