Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ''' Define your function here '''
- def GetUserValues():
- user_int = int(input())
- lst = []
- for i in range(user_int):
- lst.append(int(input()))
- if IsListEven(lst):
- print('all even')
- elif(IsListOdd(lst)):
- print('all odd')
- else:
- print('not even or odd')
- def IsListEven(lst2):
- count = 0
- for i in range(len(lst2)):
- if lst2[i] %2 == 0:
- count += 1
- if count == len(lst2):
- return True
- else:
- return False
- def IsListOdd(lst2):
- count = 0
- for i in range(len(lst2)):
- if lst2[i] %2 != 0:
- count += 1
- if count == len(lst2):
- return True
- else:
- return False
- # The statement below replaces def main(): Do not elminate it. Write your main program after this statement.
- if __name__ == '__main__':
- ''' Type your code here. '''
- GetUserValues()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement