c# - 给 Python 程序员写 C# 的建议

标签 c# python

我看过这个question关于对编写 Python 代码的 C# 程序员的建议,但我的方向相反。

对于编写 C# 代码的 Python 程序员,有哪些提示、技巧和注意事项?

最佳答案

以下是我的问题所指的一些示例:

  • enumerate() in C#

    另一种可能性:

    "abc".Where((x,i) => true).Select((x, i) => string.Format("{0}: {1}", i, x))
    
    0: a
    1: b
    2: c
    
  • list comprehension in C#

    List<Foo> fooList = new List<Foo>();
    IEnumerable<Foo> extract = from foo in fooList where foo.Bar > 10 select Foo.Name.ToUpper();
    

关于c# - 给 Python 程序员写 C# 的建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4104885/

相关文章:

c# - 2013 年末使用 Oracle 数据库的 .NET 应用程序有哪些数据访问选项?

python - PySide2 无法通过基本示例正确关闭

python - 创建分层 python 对象,其中方法的参数来自层次结构

python - 将 jsonschema 转换为 Django REST 序列化器的工具?

c# - 使用泛型类实现非泛型接口(interface)

c# - DbExpressionBinding 需要带有集合 ResultType 的输入表达式。参数名称: input

c# - 快速旋转/变换矩阵乘法

javascript - MVC4 中的自动完成

python - numpy:用于数组划分的简明条件语法

python - 用 NumPy 向量化 groupby