12. Write a python program to check whether all the numbers in the list a actually greater than certain number.
The output is:
list_a = [5,6,9,10,12,15]
number: 4 and 9
Expected Answer:
All numbers in the list greater than 4: True
All numbers in the list greater than 9: False
Sample Answer:
list_a = [5,6,9,10,12,15] print('All numbers in the list greater than 4:', all(x > 4 for x in num)) print('All numbers in the list greater than 9:', all(x > 9 for x in num))
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)