Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
import os

if not os.path.exists('test.png'):
	# do something if 'test.png' does not exist
	pass


Algorithms

Check all unique or not

Code Block
def all_unique(lst):
    return len(lst) == len(set(lst))


x = [1,1,2,2,3,2,3,4,5,6]
y = [1,2,3,4,5]
all_unique(x) # False
all_unique(y) # True


Palindrome number - Determine whether an integer is a palindrome

...