I want to pass an array, int to a function of different file and I want to return int(1 to 9)
I have simplified it but it is still showing error E1125
# in basic.py
import neural_network as nu
import numpy as np
import math
import neural_network as nu
def AI_connector():
Inputv = np.zeros((9), dtype=float) # input array
size=9
return nu.connector(Inputv,size)
# in neural_network.py
import numpy as np
import math
import random
Inputv = np.zeros((9), dtype=float) #input array
def connector(myList=[], *args,size):
Inputv = np.zeros((size), dtype=float) #input array
Inputv=myList
return 0
This line
def connector(myList=[], *args,size):
should be
def connector(size, myList=[], *args):
You always put the default arguments first, then the non-default ones. You put *args
and **kwargs
in the end.