我知道这听起来很愚蠢,但是在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);
}
}
预先感谢!