有没有办法制作自定义的dunder方法?

时间:2019-09-25 00:26:01

标签: python

我知道这听起来很愚蠢,但是在Python 3.7中有没有办法做这样的事情?

public class doubleEntries {

    public static int[] a = { 1, 1, 1, 1, 1};           1

    public static int[] doubleArray (int[] A) {
        int[] answer;
        answer = new int[A.length];
        for (int s : answer) {
            answer[s] = A[s] * 2;
        }
        // System.out.println("Hi"); //this was for testing purposes only
        return answer;
    }

    public static void main (String[] args) {
        doubleArray(a); 
    }
}

预先感谢!

0 个答案:

没有答案