fork download
  1. def isAlt(a):
  2. if len(a)<=1:
  3. return False
  4. for i in range(1, len(a)+1):
  5. if a[i]*a[i-1] > 0:
  6. return False
  7. return True
  8.  
  9.  
  10. def isGrow(a):
  11. if len(a)<=1:
  12. return False
  13. for i in range(1, len(a)+1):
  14. if a[i] < a[i-1]:
  15. return False
  16. return True
  17.  
  18. def isMulti(a):
  19. q = a[1]/a[0]
  20. if len(a)<=1:
  21. return False
  22. for i in range(2, len(a)):
  23. if a[i] / a[i-1] != q:
  24. return False
  25. return True
  26.  
  27. def isAdd(a):
  28. q = a[1]-a[0]
  29. if len(a)<=1:
  30. return False
  31. for i in range(2, len(a)):
  32. if a[i] - a[i-1] != q:
  33. return False
  34. return True
Success #stdin #stdout 0.05s 9676KB
stdin
Standard input is empty
stdout
Standard output is empty