<jupyter_start><jupyter_text><jupyter_code>#Palindrome

def check_pallindrome(num):
  str_num=str(num)
  len_str_num=len(str_num)
  for i in range(len_str_num):
    if str_num[i]==str_num[len_str_num-1-i]:
      continue
    else: return False
  return True

def pallindrome(num):
  for i in range(num,1000*1000):
    if(check_pallindrome(i)):
      return i

print(pallindrome(135))
#a_scramble

def a_scramble(str_1,str_2):
  for i in list(str_1):
    if i not in list(str_2):
      return False
    else:
      continue
  return True
a_scramble('anish','Manish')
#Fibonacci

def gen_fib(num):
  fib=[1,1]
  for i in range(num):
    fib.append(fib[i]+fib[i+1])
  return fib

print(gen_fib(10))
def check_fib(num):
  if num in gen_fib(num):
    return True

check_fib(4)
#String Compress

def compress_word(word):
  count=1
  str_new=''
  list_word=list(word)

  for i in range(len(list_word)):
    print(i)
    if list_word[i]==list_word[i+1]:
      count+=1
      continue
    else:
      str_new=str_new+str(list_word[i])+str(count)
  
  return str_new
    
compress_word('Anish')
#k-distinct
distinct_count=0
distinct_list=[]

def k_distinct(string,k):
  word=list(string)
  distinct_list=list(set(string.lower()))
  print(distinct_list)
  len_dist_list=len(distinct_list)
  if len_dist_list==k:
    return True
  return False

k_distinct('Ganesan',5)<jupyter_output>['a', 's', 'e', 'n', 'g']
{'fraction_non_alphanumeric': 0.13672154617036505, 'fraction_numerical': 0.019327129563350035, 'mean_word_length': 4.33587786259542, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '245405', 'license': 'MIT', 'n_tokens_mistral': 608, 'n_tokens_neox': 585, 'n_words': 108, 'path': 'RoughForTestOn8Feb.ipynb', 'repo_name': 'anishdass/intro-to-ds', 'size': '1397'}