This program should create an array in main and prompts the user to enter 5 integers and store them in the array in a function called fibArray. It then creates a function named containOnlyOdd that excepts 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 such as ex: [1,2,3,4,5] "The array contains both odd and even numbers." or [1,3,5,7,9] "The array contains only odd numbers.
The error is get is in line 10 in fibArray which is fibArray = [0] * num. TypeError: Can't multiply sequence by non-int of type list.
def main():
integer = 5
intArray = [0] * integer
for index in range(integer):
intArray[index] = int(input("Enter integers:"))
print(intArray)
fibArray(intArray)
def fibArray(num):
fibArray = [0] * num
for index in range(num):
print(num)
def containsOnlyOdds(lst):
for num in lst:
if num % 2 == 0
#print("This list is all odd")
return false`
#print("This list has even numbers")
return True
main()
What am I doing wrong? Please help!!