Menu Close

Total Number of Odds in the list

N=int(input(“Enter the N number: “))
or
you can use
N=list(map(int,input(“Enter the N number: “).split()))

N=int(input("Enter the N number: ")) # or you can use N=list(map(int,input("Enter the N number: ").split()))
A=[]
for i in range(N):
	digit=int(input("Enter the numbers: "))
	A.append(digit)

# The above step can be completed in one line-->       A=list(map(int,input("Enter the numbers : ").split("")))
# And for N--->                                        N=len(A)

occuring=0

for i in range(N):
	if (A[i]%2!=0):
		occuring+=1

print("Total number of odds in list is {}".format(occuring))

you can use:
N=list(map(int,input(“Enter the N number: “).split()))

we will get Input/output as shown below

More Codes to Fcuk