[英]How to replace elements in a list using dictionary lookup (list as values in dict)
[英]How to replace elements in python list by values from dictionary if list-element = dict-key?
输入:
[yellow, red, green, blue]
{green:go, yellow:attention, red:stay}
如何制作新列表:
[attention, stay, go, blue]
有没有办法用 lambda 制作它?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.