Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkSum(list):
- #@param list : list
- #@return bool (vero per lista vuota o se somma= numero pari, falso se somma= numero dispari)
- if len(list)==0:
- return 'vero'
- elif len(list)==1:
- global sum
- sum=list[0]
- if sum%2==0:
- return 'vero'
- else:
- return 'falso'
- else:
- n=list.pop(0)
- funcInt(list)
- sum=sum+n
- if sum%2==0:
- return 'vero'
- else:
- return 'falso'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement