+ 1
Как упростить код?
car = { 'brand':'BMW', 'year': 2018, 'color': 'red', 'mileage': 15000 } x=input() if x=='brand': print(car['brand']) elif x=='year': print(car['year']) elif x=='color': print(car['color']) elif x=='mileage': print(car['mileage'])
2 Answers
+ 2
x=input()
print(car[x])
+ 1
NEZ …😅😅
Thx))