+ 1
Can someone help me pls ???
How to output the only value which is a number
3 Answers
+ 5
What do you mean "the only value which is a number"
+ 3
Use filter() to get matching values from Car.values(). You can use lambda combined with isinstance() to verify that type of lambda's argument was any numeric type (int, float).
0
Car = {'brand': 'BMW',
'year': 2018,
'color': 'red'}
key = input()
print(car[key])