Write a python program that returns the first element of a list, if there is any, and
None is the list is empty.
The program should return the first element or a special
Write a program that returns the last c-part of a list!
If the list is shorter than c then return a
None value. Otherwise return the list of the last c elements.
Write a program which evaluates whether a number is perfect.
Let L be a list of numbers, write a function that separates its elements into two lists: one for positive and one for non-positive elements. For example
L = [-1, 2, 5, -2, 3, -4, -5, 2, -2, 0, 5, 5, 6, 3, -3]
Then the result should be two lists.
Write a program that finds the largest value in a list and returns the value.
Write a program that finds the largest value in a list and returns the index of that element.
The function should be called
argmax, should have one parameter: l the list of numbers.
The function should return the index of the largest element. For example
[3, 2, 1] should result 0.
We have two parameters: a list of numbers l and an additional number k. The output should be a list where every number is k times the corresponding number in l.
Write a python program that remove any duplicate value in a list and return a new list with contains no duplicate.
Given two lists. Write a python program that returns true if there is the same value in both lists and returns false otherwise.
Given a list. write a python program which takes all odd values in the list and returns the odd list.