May-07-2017, 03:31 PM
(This post was last modified: May-07-2017, 09:08 PM by sparkz_alot.)
Python - Exercise 5
1. Write a function that gets a list (list) of numbers. The function returns a new list of ordered square numbers from the smallest to grow.
For example, for the list [2, 4, 5, 3, 1] the function returns
[25, 16, 9, 4, 1].
2. Write a function that receives a list (list) and a number. The function returns the number of times the number appears in the list.
For example, for list [2, 4, 2, 3, 2] and number 2 will return 3 because number 2 is listed 3 times.
The answers here:
1. Write a function that gets a list (list) of numbers. The function returns a new list of ordered square numbers from the smallest to grow.
For example, for the list [2, 4, 5, 3, 1] the function returns
[25, 16, 9, 4, 1].
2. Write a function that receives a list (list) and a number. The function returns the number of times the number appears in the list.
For example, for list [2, 4, 2, 3, 2] and number 2 will return 3 because number 2 is listed 3 times.
The answers here: