Python: Filter the height and width of students which are stored in a dictionary using lambda
34. Student Height/Weight Filter Lambda
Write a Python program to filter the height and width of students, which are stored in a dictionary using lambda.
Sample Solution:
Python Code :
Sample Output:
Original Dictionary: {'Cierra Vega': (6.2, 70), 'Alden Cantrell': (5.9, 65), 'Kierra Gentry': (6.0, 68), 'Pierre Cox': (5.8, 66)} Height> 6ft and Weight> 70kg: {'Cierra Vega': (6.2, 70)}
For more Practice: Solve these Related Problems:
- Write a Python program to filter students from a dictionary based on weight and age using lambda.
- Write a Python program to filter a dictionary of students to include only those whose height is above a threshold and whose names start with a vowel using lambda.
- Write a Python program to filter a dictionary of students by height range and a minimum score using lambda.
- Write a Python program to filter students based on multiple criteria such as height, weight, and gender using lambda.
Go to:
Previous: Write a Python program to check whether a given string contains a capital letter, a lower case letter, a number and a minimum length using lambda.
Next: Write a Python program to check whether a specified list is sorted or not using lambda.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.