This program creates an array in main and prompts the user to enter 5 integers and stores them in a array in a different function. It then creates a function that accepts the array and returns a true if the array contains only odd numbers or false if it does not. Print a message indicating the results being either the array contains both odd and even numbers or the array contains only odd numbers.
I keep getting TypeError:Unsupported operand types for /: 'list' and 'int'.
def main():
integer = 5
intArray = [0] * integer
for index in range(integer):
intArray[index] = int(input("Enter integers:"))
print(intArray)
fibArray(integer)
containsOnlyOdds(intArray)
return intArray
def fibArray(num):
fibArray = [0] * num
for index in range(num):
print(num)
def containsOnlyOdds(notEven):
average = (notEven / 2) % 2
for odd in range(average):
if notEven %2 != 0:
print('This array contains only odd numbers')
else:
print('This array contains odd and even numbers')
main()