Skip to content

Instantly share code, notes, and snippets.

@Unitoi01
Created May 11, 2018 03:27
Show Gist options
  • Save Unitoi01/b76e4e4327a606ad1407c763d04b6a66 to your computer and use it in GitHub Desktop.
Save Unitoi01/b76e4e4327a606ad1407c763d04b6a66 to your computer and use it in GitHub Desktop.
Python even array
myIntArray= [1,2,3,4,5,6,7,8]
ans=0
#pound signs are to comment, also there are no arrays in Python, only lists! Which are better
for i in range(len(myIntArray)):
if(myIntArray[i]%2=0):
ans=ans+1
print("there are"+ans+" "+"many even numbers")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment