小编Vik*_*ash的帖子

Python错误"IndentationError:期望缩进块"

这是我的程序,我收到以下提到的错误:

def main():
    print "hello"

if __name__=='__main__':
main()
Run Code Online (Sandbox Code Playgroud)

错误

  File "hello.py", line 8
    main()
    ^
IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud)

python

1
推荐指数
2
解决办法
8318
查看次数

静态构造函数行为(C#)

静态构造函数在这里的表现如何?

class a
{    
    public static int x;
    static a()
    {
        x = b.y + 1;    
    }
}

class b    
{    
    public static int y = a.x + 1;

    static b()
    { 

    }

    static void Main(String[] args)
    {
       Console.WriteLine("x={0} , y={1} ", a.x, b.y);
        Console.ReadLine();    
    }
}
Run Code Online (Sandbox Code Playgroud)

输出::

x = 1,y = 2

怎么样 ?

c#

0
推荐指数
1
解决办法
146
查看次数

每个字符出现在一个字符串中

如何编写一个javascript代码来计算字符串中每个字符的出现次数?

e.g 
String is : Hello World 

Output :  
count of H -> 1
count of e -> 1
count of l -> 3
count of o -> 2 
count of r -> 1
count of d -> 1 
count of W -> 1 
Run Code Online (Sandbox Code Playgroud)

javascript

0
推荐指数
1
解决办法
2134
查看次数

标签 统计

c# ×1

javascript ×1

python ×1