Python翻译为C#
我想将Python转换为C#。有一块我无法理解的Python代码。请指教。Python翻译为C#
AppList = {
"POLE" : set()
}
knownlist = AppList.get(ApplicationName.upper(),CardNumbers)
// ApplicationName是一些字符串变量。
// CardNumbers是整数的集合。
这里是我的问题:
什么是APPLIST在这里,它是一个集合或C#某种属性的怎么样?
AppList.get如何获取2个参数?这里的输出是什么?
什么是APPLIST在这里,它是一个集合或某种属性的像在C# ?
AppList是Python中的字典。
AppList.get如何获取2个参数?这里的输出是什么?
方法get()返回“ApplicationName.upper()”的值。如果“ApplicationName.upper()”不可用,则返回默认值即CardNumbers。
谢谢。下面的代码意味着AppList字典包含一个名为“POLE”的项目。 AppList = { “POLE”:set() } –
***是*** @Rahul B – anati
'AppList'是一个字典。 – cdarke
请参阅['dict.get'](https://docs.python.org/3/library/stdtypes.html#dict.get)方法的文档。 –