taking input array in int code example
Example 1: how to get an array as input in java
public class TakingInput {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("enter number of elements");
int n=s.nextInt();
int arr[]=new int[n];
System.out.println("enter elements");
for(int i=0;i<n;i++){
arr[i]=s.nextInt();
}
for(int i: arr){
System.out.println(i);
}
}
}
Example 2: enter elements in array in python
import array as arr
# Error
a = arr.array('d', [1, 3.5, "Hello"])